| @@ -7,6 +7,6 @@ | ||
| 7 | 7 |  { | 
| 8 | 8 | public static function cannotHandleEvent(string $eventName): self | 
| 9 | 9 |      { | 
| 10 | -        throw new self('Could not find an Aent that can handle events of type "'.$eventName.'"'); | |
| 10 | +        throw new self('Could not find an Aent that can handle events of type "' . $eventName . '"'); | |
| 11 | 11 | } | 
| 12 | 12 | } | 
| @@ -112,7 +112,7 @@ discard block | ||
| 112 | 112 | $validator = $this->validator; | 
| 113 | 113 | |
| 114 | 114 |          if ($this->yesNoQuestion) { | 
| 115 | -            $validator = function (?string $response) use ($validator) { | |
| 115 | +            $validator = function(?string $response) use ($validator) { | |
| 116 | 116 | $response = $response ?? ''; | 
| 117 | 117 | $response = \strtolower(trim($response)); | 
| 118 | 118 |                  if (!\in_array($response, ['y', 'n', 'yes', 'no'])) { | 
| @@ -124,7 +124,7 @@ discard block | ||
| 124 | 124 | } | 
| 125 | 125 | |
| 126 | 126 |          if ($this->helpText !== null) { | 
| 127 | -            $validator = function (?string $response) use ($validator) { | |
| 127 | +            $validator = function(?string $response) use ($validator) { | |
| 128 | 128 | $response = $response ?? ''; | 
| 129 | 129 |                  if (trim($response) === '?') { | 
| 130 | 130 | $this->output->writeln($this->helpText ?: ''); | 
| @@ -135,7 +135,7 @@ discard block | ||
| 135 | 135 | } | 
| 136 | 136 | |
| 137 | 137 |          if ($this->compulsory) { | 
| 138 | -            $validator = function (?string $response) use ($validator) { | |
| 138 | +            $validator = function(?string $response) use ($validator) { | |
| 139 | 139 | $response = $response ?? ''; | 
| 140 | 140 |                  if (trim($response) === '') { | 
| 141 | 141 |                      throw new \InvalidArgumentException('This field is compulsory.'); | 
| @@ -17,7 +17,7 @@ | ||
| 17 | 17 | public function filterBestTags(array $tags): array | 
| 18 | 18 |      { | 
| 19 | 19 | // filter numeric versions only | 
| 20 | -        $versions = \array_filter($tags, function (string $tag) { | |
| 20 | +        $versions = \array_filter($tags, function(string $tag) { | |
| 21 | 21 |              return \preg_match('/^\d+(\.\d+)*$/', $tag); | 
| 22 | 22 | }); | 
| 23 | 23 | |
| @@ -18,7 +18,7 @@ | ||
| 18 | 18 | |
| 19 | 19 | $response = \GuzzleHttp\json_decode($res->getBody(), true); | 
| 20 | 20 | |
| 21 | -        $tags = \array_map(function (array $item) { | |
| 21 | +        $tags = \array_map(function(array $item) { | |
| 22 | 22 | return $item['name']; | 
| 23 | 23 | }, $response); | 
| 24 | 24 | |
| @@ -15,9 +15,9 @@ discard block | ||
| 15 | 15 | public function __construct(string $replyDirectory = null) | 
| 16 | 16 |      { | 
| 17 | 17 |          if ($replyDirectory === null) { | 
| 18 | - $replyDirectory = \sys_get_temp_dir().'/replies'; | |
| 18 | + $replyDirectory = \sys_get_temp_dir() . '/replies'; | |
| 19 | 19 | } | 
| 20 | - $this->replyDirectory = rtrim($replyDirectory, '/').'/'; | |
| 20 | + $this->replyDirectory = rtrim($replyDirectory, '/') . '/'; | |
| 21 | 21 |          if (!\file_exists($replyDirectory)) { | 
| 22 | 22 |              if (!mkdir($replyDirectory, 0777, true) && !is_dir($replyDirectory)) { | 
| 23 | 23 |                  throw new \RuntimeException(sprintf('Directory "%s" was not created', $replyDirectory)); | 
| @@ -30,7 +30,7 @@ discard block | ||
| 30 | 30 | */ | 
| 31 | 31 | public function clear(): void | 
| 32 | 32 |      { | 
| 33 | - $files = glob($this->replyDirectory.'*'); // get all file names | |
| 33 | + $files = glob($this->replyDirectory . '*'); // get all file names | |
| 34 | 34 |          foreach ($files as $file) { // iterate files | 
| 35 | 35 |              if (is_file($file)) { | 
| 36 | 36 | unlink($file); // delete file | 
| @@ -41,15 +41,15 @@ discard block | ||
| 41 | 41 | private function getNextFileName(): string | 
| 42 | 42 |      { | 
| 43 | 43 | $i = 0; | 
| 44 | -        while (\file_exists($this->replyDirectory.'tmp'.$i)) { | |
| 44 | +        while (\file_exists($this->replyDirectory . 'tmp' . $i)) { | |
| 45 | 45 | $i++; | 
| 46 | 46 | } | 
| 47 | - return 'tmp'.$i; | |
| 47 | + return 'tmp' . $i; | |
| 48 | 48 | } | 
| 49 | 49 | |
| 50 | 50 | public function storeReply(string $payload): void | 
| 51 | 51 |      { | 
| 52 | - $path = $this->replyDirectory.$this->getNextFileName(); | |
| 52 | + $path = $this->replyDirectory . $this->getNextFileName(); | |
| 53 | 53 | \file_put_contents($path, $payload); | 
| 54 | 54 | } | 
| 55 | 55 | |
| @@ -60,10 +60,10 @@ discard block | ||
| 60 | 60 |      { | 
| 61 | 61 | $i = 0; | 
| 62 | 62 | $replies = []; | 
| 63 | -        while (\file_exists($this->replyDirectory.'tmp'.$i)) { | |
| 64 | - $content = \file_get_contents($this->replyDirectory.'tmp'.$i); | |
| 63 | +        while (\file_exists($this->replyDirectory . 'tmp' . $i)) { | |
| 64 | + $content = \file_get_contents($this->replyDirectory . 'tmp' . $i); | |
| 65 | 65 |              if ($content === false) { | 
| 66 | -                throw new \RuntimeException('Failed to load file '.$this->replyDirectory.'tmp'.$i); | |
| 66 | +                throw new \RuntimeException('Failed to load file ' . $this->replyDirectory . 'tmp' . $i); | |
| 67 | 67 | } | 
| 68 | 68 | $replies[] = $content; | 
| 69 | 69 | $i++; | 
| @@ -126,7 +126,7 @@ | ||
| 126 | 126 |              throw new \RuntimeException('Payload object should implement JsonSerializable. Got an instance of ' . \get_class($payload)); | 
| 127 | 127 | } | 
| 128 | 128 | $replies = self::dispatch($event, \GuzzleHttp\json_encode($payload)); | 
| 129 | -        return \array_map(function (string $reply) { | |
| 129 | +        return \array_map(function(string $reply) { | |
| 130 | 130 | return \GuzzleHttp\json_decode($reply, true); | 
| 131 | 131 | }, $replies); | 
| 132 | 132 | } | 
| @@ -73,9 +73,9 @@ | ||
| 73 | 73 | */ | 
| 74 | 74 | public function getAllEventNames(): array | 
| 75 | 75 |      { | 
| 76 | -        return array_map(function (EventCommand $event) { | |
| 76 | +        return array_map(function(EventCommand $event) { | |
| 77 | 77 | return $event->getEventName(); | 
| 78 | -        }, \array_filter($this->getApplication()->all(), function (Command $command) { | |
| 78 | +        }, \array_filter($this->getApplication()->all(), function(Command $command) { | |
| 79 | 79 | return $command instanceof EventCommand && !$command->isHidden(); | 
| 80 | 80 | })); | 
| 81 | 81 | } | 
| @@ -44,7 +44,7 @@ discard block | ||
| 44 | 44 | |
| 45 | 45 | public function __construct() | 
| 46 | 46 |      { | 
| 47 | - $this->validatorSchema = \GuzzleHttp\json_decode((string)file_get_contents(__DIR__ . '/ServiceJsonSchema.json'), false); | |
| 47 | + $this->validatorSchema = \GuzzleHttp\json_decode((string) file_get_contents(__DIR__ . '/ServiceJsonSchema.json'), false); | |
| 48 | 48 | } | 
| 49 | 49 | |
| 50 | 50 | /** | 
| @@ -92,7 +92,7 @@ discard block | ||
| 92 | 92 | */ | 
| 93 | 93 | public function jsonSerialize(): array | 
| 94 | 94 |      { | 
| 95 | -        $jsonSerializeMap = function (\JsonSerializable $obj): array { | |
| 95 | +        $jsonSerializeMap = function(\JsonSerializable $obj): array { | |
| 96 | 96 | return $obj->jsonSerialize(); | 
| 97 | 97 | }; | 
| 98 | 98 | |
| @@ -135,7 +135,7 @@ discard block | ||
| 135 | 135 | $dockerfileCommands[] = 'FROM ' . $this->image; | 
| 136 | 136 |          foreach ($this->environment as $key => $env) { | 
| 137 | 137 |              if ($env->getType() === EnvVariableTypeEnum::IMAGE_ENV_VARIABLE) { | 
| 138 | - $dockerfileCommands[] = "ENV $key" . '='. $env->getValue(); | |
| 138 | + $dockerfileCommands[] = "ENV $key" . '=' . $env->getValue(); | |
| 139 | 139 | } | 
| 140 | 140 | } | 
| 141 | 141 |          foreach ($this->volumes as $volume) { | 
| @@ -86,9 +86,9 @@ discard block | ||
| 86 | 86 | $choices = $this->choices; | 
| 87 | 87 | $errorMessage = 'Value "%s" is invalid'; | 
| 88 | 88 | $multiselect = $this->multiselect; | 
| 89 | - $isAssoc = (bool)count(array_filter(array_keys($this->choices), '\is_string')); | |
| 89 | + $isAssoc = (bool) count(array_filter(array_keys($this->choices), '\is_string')); | |
| 90 | 90 | |
| 91 | -        return function ($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) { | |
| 91 | +        return function($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) { | |
| 92 | 92 | |
| 93 | 93 | // Collapse all spaces. | 
| 94 | 94 |              $selectedChoices = str_replace(' ', '', $selected); | 
| @@ -136,7 +136,7 @@ discard block | ||
| 136 | 136 |                  if (false === $result) { | 
| 137 | 137 | throw new InvalidArgumentException(sprintf($errorMessage, $value)); | 
| 138 | 138 | } | 
| 139 | - $multiselectChoices[] = (string)$result; | |
| 139 | + $multiselectChoices[] = (string) $result; | |
| 140 | 140 | } | 
| 141 | 141 |              if ($multiselect) { | 
| 142 | 142 |                  if ($this->printAnswer) { |