Passed
Pull Request — master (#36)
by Jindun
02:06
created
src/Exception/CannotHandleEventException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,6 +7,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Service/Service.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
      */
82 82
     public function jsonSerialize(): array
83 83
     {
84
-        $jsonSerializeMap = function (\JsonSerializable $obj): array {
84
+        $jsonSerializeMap = function(\JsonSerializable $obj): array {
85 85
             return $obj->jsonSerialize();
86 86
         };
87 87
 
Please login to merge, or discard this patch.
src/AentHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             ->setDefault($serviceName)
74 74
             ->compulsory()
75 75
             ->setHelpText('The "service name" is used as an identifier for the container you are creating. It is also bound in Docker internal network DNS and can be used from other containers to reference your container.')
76
-            ->setValidator(function (string $value) {
76
+            ->setValidator(function(string $value) {
77 77
                 $value = trim($value);
78 78
                 if (!\preg_match('/^[a-zA-Z0-9_.-]+$/', $value)) {
79 79
                     throw new \InvalidArgumentException('Invalid service name "' . $value . '". Service names can contain alphanumeric characters, and "_", ".", "-".');
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             $default
112 112
         );
113 113
         $question->setAutocompleterValues($availableVersions);
114
-        $question->setValidator(function (string $value) use ($availableVersions, $dockerHubImage) {
114
+        $question->setValidator(function(string $value) use ($availableVersions, $dockerHubImage) {
115 115
             $value = trim($value);
116 116
 
117 117
             if ($value === 'v') {
Please login to merge, or discard this patch.
src/Registry/TagsAnalyzer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Registry/RegistryClient.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/ReplyAggregator.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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++;
Please login to merge, or discard this patch.
src/Aenthill.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Helper/Question.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $validator = $this->validator;
126 126
 
127 127
         if ($this->yesNoQuestion) {
128
-            $validator = function (?string $response) use ($validator) {
128
+            $validator = function(?string $response) use ($validator) {
129 129
                 $response = $response ?? '';
130 130
                 $response = \strtolower(trim($response));
131 131
                 if (!\in_array($response, ['y', 'n', 'yes', 'no'])) {
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         }
138 138
 
139 139
         if ($this->choiceQuestion) {
140
-            $validator = function (?string $response) use ($validator) {
140
+            $validator = function(?string $response) use ($validator) {
141 141
                 $response = $response ?? '';
142 142
                 if (!$this->multiselectQuestion) {
143 143
                     $index = intval($response);
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         }
153 153
 
154 154
         if ($this->helpText !== null) {
155
-            $validator = function (?string $response) use ($validator) {
155
+            $validator = function(?string $response) use ($validator) {
156 156
                 $response = $response ?? '';
157 157
                 if (trim($response) === '?') {
158 158
                     $this->output->writeln($this->helpText ?: '');
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         }
164 164
 
165 165
         if ($this->compulsory) {
166
-            $validator = function (?string $response) use ($validator) {
166
+            $validator = function(?string $response) use ($validator) {
167 167
                 $response = $response ?? '';
168 168
                 if (trim($response) === '') {
169 169
                     throw new \InvalidArgumentException('This field is compulsory.');
Please login to merge, or discard this patch.
src/EventCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,9 +73,9 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.