Skip to content

Commit 9aad043

Browse files
removed useless code
1 parent ecde056 commit 9aad043

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/Console/Helper/Question/AlwaysReturnKeyOfChoiceQuestion.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function getValidator()
6969

7070
if ($this->_multiselect) {
7171
// Check for a separated comma values
72-
if (!preg_match('/^[a-zA-Z0-9_-]+(?:,[a-zA-Z0-9_-]+)*$/', $selectedChoices, $matches)) {
72+
if (!preg_match('/^[a-zA-Z0-9_-]+(?:,[a-zA-Z0-9_-]+)*$/', $selectedChoices)) {
7373
throw new \InvalidArgumentException(sprintf($this->_errorMessage, $selected));
7474
}
7575
$selectedChoices = explode(',', $selectedChoices);

src/Console/Input/CachedInputDefinitionFactory.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ public function createForFormType($formType, array &$resources = [])
4646

4747
if ($cache->isFresh()) {
4848
return $this->inputDefinitionFromCache($cache);
49-
} else {
50-
return $this->freshInputDefinition($formType, $cache, $resources);
5149
}
50+
51+
return $this->freshInputDefinition($formType, $cache, $resources);
5252
}
5353

5454
/**
@@ -60,9 +60,7 @@ protected function configCacheFor($formType)
6060
{
6161
$filename = $formType instanceof FormTypeInterface ? $formType->getName() : $formType;
6262

63-
$cache = new ConfigCache($this->cacheDirectory . '/' . $filename, $this->debug);
64-
65-
return $cache;
63+
return new ConfigCache($this->cacheDirectory.'/'.$filename, $this->debug);
6664
}
6765

6866
/**

0 commit comments

Comments
 (0)