@@ -7,6 +7,6 @@ |
||
| 7 | 7 | { |
| 8 | 8 | public static function cannotHandleEvent(string $eventName): self |
| 9 | 9 | { |
| 10 | - return new self('Could not find an Aent that can handle events of type "'.$eventName.'"'); |
|
| 10 | + return new self('Could not find an Aent that can handle events of type "' . $eventName . '"'); |
|
| 11 | 11 | } |
| 12 | 12 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function __construct() |
| 63 | 63 | { |
| 64 | - $this->validatorSchema = \GuzzleHttp\json_decode((string)file_get_contents(__DIR__ . '/ServiceJsonSchema.json'), false); |
|
| 64 | + $this->validatorSchema = \GuzzleHttp\json_decode((string) file_get_contents(__DIR__ . '/ServiceJsonSchema.json'), false); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function jsonSerialize(): array |
| 118 | 118 | { |
| 119 | - $jsonSerializeMap = function (JsonSerializable $obj): array { |
|
| 119 | + $jsonSerializeMap = function(JsonSerializable $obj): array { |
|
| 120 | 120 | return $obj->jsonSerialize(); |
| 121 | 121 | }; |
| 122 | 122 | |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | |
| 490 | 490 | private function removeVolumesByType(string $type): void |
| 491 | 491 | { |
| 492 | - $filterFunction = function (Volume $vol) use ($type) { |
|
| 492 | + $filterFunction = function(Volume $vol) use ($type) { |
|
| 493 | 493 | return $vol->getType() !== $type; |
| 494 | 494 | }; |
| 495 | 495 | $this->volumes = array_values(array_filter($this->volumes, $filterFunction)); |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | |
| 513 | 513 | public function removeVolumesBySource(string $source): void |
| 514 | 514 | { |
| 515 | - $filterFunction = function (Volume $vol) use ($source) { |
|
| 515 | + $filterFunction = function(Volume $vol) use ($source) { |
|
| 516 | 516 | return $vol->getSource() !== $source; |
| 517 | 517 | }; |
| 518 | 518 | $this->volumes = array_values(array_filter($this->volumes, $filterFunction)); |
@@ -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) { |