@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $validator = $this->validator; |
| 76 | 76 | |
| 77 | 77 | if ($this->yesNoQuestion) { |
| 78 | - $validator = function (?string $response) use ($validator) { |
|
| 78 | + $validator = function(?string $response) use ($validator) { |
|
| 79 | 79 | $response = $response ?? ''; |
| 80 | 80 | $response = \strtolower(trim($response)); |
| 81 | 81 | if (!\in_array($response, ['y', 'n', 'yes', 'no'], true)) { |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | if (null !== $this->helpText) { |
| 90 | - $validator = function (?string $response) use ($validator) { |
|
| 90 | + $validator = function(?string $response) use ($validator) { |
|
| 91 | 91 | $response = $response ?? ''; |
| 92 | 92 | if (trim($response) === '?') { |
| 93 | 93 | $this->output->writeln($this->helpText ?: ''); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | if ($this->compulsory) { |
| 101 | - $validator = function (?string $response) use ($validator) { |
|
| 101 | + $validator = function(?string $response) use ($validator) { |
|
| 102 | 102 | $response = $response ?? ''; |
| 103 | 103 | if (trim($response) === '') { |
| 104 | 104 | throw new \InvalidArgumentException('This field is compulsory.'); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | return $validator ? $validator($response) : $response; |
| 107 | 107 | }; |
| 108 | 108 | } else { |
| 109 | - $validator = function (?string $response) use ($validator) { |
|
| 109 | + $validator = function(?string $response) use ($validator) { |
|
| 110 | 110 | $response = $response ?? ''; |
| 111 | 111 | if (trim($response) === '') { |
| 112 | 112 | return $response; |
@@ -131,6 +131,6 @@ discard block |
||
| 131 | 131 | } |
| 132 | 132 | $this->spacer(); |
| 133 | 133 | |
| 134 | - return \is_string($answer)? $answer: (string)$answer; |
|
| 134 | + return \is_string($answer) ? $answer : (string) $answer; |
|
| 135 | 135 | } |
| 136 | 136 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | $question = new SymfonyQuestion("Select your $applicationName version [$default]: ", $default); |
| 61 | 61 | |
| 62 | 62 | $question->setAutocompleterValues($availableVersions); |
| 63 | - $question->setValidator(function (string $value) use ($availableVersions, $dockerHubImage) { |
|
| 63 | + $question->setValidator(function(string $value) use ($availableVersions, $dockerHubImage) { |
|
| 64 | 64 | $value = trim($value); |
| 65 | 65 | |
| 66 | 66 | if ($value === 'v') { |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $answer = $this->helper->ask($this->input, $this->output, $question); |
| 46 | 46 | } while ($this->helpText !== null && $answer === '?'); |
| 47 | 47 | |
| 48 | - return \is_string($answer) ? $answer : (string)$answer; |
|
| 48 | + return \is_string($answer) ? $answer : (string) $answer; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** @return string[] */ |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $answer = $this->helper->ask($this->input, $this->output, $question); |
| 58 | 58 | } while ($this->helpText !== null && $answer === '?'); |
| 59 | 59 | |
| 60 | - return \is_array($answer) ? $answer : [\is_string($answer) ? $answer : (string)$answer]; |
|
| 60 | + return \is_array($answer) ? $answer : [\is_string($answer) ? $answer : (string) $answer]; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | private function initQuestion(bool $multiselect): SymfonyChoiceQuestion |
@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | $choices = $this->choices; |
| 86 | 86 | $errorMessage = 'Value "%s" is invalid'; |
| 87 | 87 | $multiselect = $this->multiselect; |
| 88 | - $isAssoc = (bool)count(array_filter(array_keys($this->choices), '\is_string')); |
|
| 88 | + $isAssoc = (bool) count(array_filter(array_keys($this->choices), '\is_string')); |
|
| 89 | 89 | |
| 90 | - return function ($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) { |
|
| 90 | + return function($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) { |
|
| 91 | 91 | |
| 92 | 92 | // Collapse all spaces. |
| 93 | 93 | $selectedChoices = str_replace(' ', '', $selected); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | if (false === $result) { |
| 136 | 136 | throw new InvalidArgumentException(sprintf($errorMessage, $value)); |
| 137 | 137 | } |
| 138 | - $multiselectChoices[] = (string)$result; |
|
| 138 | + $multiselectChoices[] = (string) $result; |
|
| 139 | 139 | } |
| 140 | 140 | if ($multiselect) { |
| 141 | 141 | if ($this->printAnswer) { |