Completed
Push — master ( 3a9941...9b76a9 )
by David
10s
created
src/Registry/RegistryClient.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@
 block discarded – undo
15 15
     public function getImageTagsOnDockerHub(string $image): array
16 16
     {
17 17
         $client = new Client();
18
-        $res = $client->request('GET', 'https://registry.hub.docker.com/v1/repositories/'.$image.'/tags');
18
+        $res = $client->request('GET', 'https://registry.hub.docker.com/v1/repositories/' . $image . '/tags');
19 19
 
20 20
         $response = \GuzzleHttp\json_decode($res->getBody(), true);
21 21
 
22
-        $tags = \array_map(function (array $item) {
22
+        $tags = \array_map(function(array $item) {
23 23
             return $item['name'];
24 24
         }, $response);
25 25
 
Please login to merge, or discard this patch.
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/EventCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,9 +58,9 @@
 block discarded – undo
58 58
      */
59 59
     private function getAllEventNames(): array
60 60
     {
61
-        return array_map(function (EventCommand $event) {
61
+        return array_map(function(EventCommand $event) {
62 62
             return $event->getEventName();
63
-        }, \array_filter($this->getApplication()->all(), function (Command $command) {
63
+        }, \array_filter($this->getApplication()->all(), function(Command $command) {
64 64
             return $command instanceof EventCommand && !$command->isHidden();
65 65
         }));
66 66
     }
Please login to merge, or discard this patch.
src/CommonEvents.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             $output->writeln('It seems that Aenthill does not know how or where to store this new service. You need to install a dedicated Aent for this.');
38 38
             $output->writeln('Most of the time, you want to put this service in a docker-compose.yml file. We have a pretty good Aent for this: <info>theaentmachine/aent-docker-compose</info>.');
39 39
             $question = new Question('Do you want me to add this Aent for you? (y/n) ', 'y');
40
-            $question->setValidator(function (string $value) {
40
+            $question->setValidator(function(string $value) {
41 41
                 $value = \strtolower(trim($value));
42 42
 
43 43
                 if ($value !== 'y' && $value !== 'n') {
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             $output->writeln('It seems that Aenthill does not know how to bind your container to a domain name. You need to install a reverse proxy for this.');
87 87
             $output->writeln('Traefik is a good reverse proxy. We have an Aent to add Traefik to your project: <info>theaentmachine/aent-traefik</info>.');
88 88
             $question = new Question('Do you want me to add this Aent for you? (y/n) ', 'y');
89
-            $question->setValidator(function (string $value) {
89
+            $question->setValidator(function(string $value) {
90 90
                 $value = \strtolower(trim($value));
91 91
 
92 92
                 if ($value !== 'y' && $value !== 'n') {
Please login to merge, or discard this patch.
src/Registry/TagsAnalyzer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     public function filterBestTags(array $tags): array
19 19
     {
20 20
         // filter numeric versions only
21
-        $versions = \array_filter($tags, function (string $tag) {
21
+        $versions = \array_filter($tags, function(string $tag) {
22 22
             return \preg_match('/^\d+(\.\d+)*$/', $tag);
23 23
         });
24 24
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         foreach ($subtree as $key => $subsubtree) {
74 74
             $values = $this->getMaxLeafs($subsubtree);
75 75
             foreach ($values as $val) {
76
-                $arr[] = $key.'.'.$val;
76
+                $arr[] = $key . '.' . $val;
77 77
             }
78 78
         }
79 79
         return $arr;
Please login to merge, or discard this patch.
src/AentHelper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -73,10 +73,10 @@  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
-                    throw new \InvalidArgumentException('Invalid service name "'.$value.'". Service names can contain alphanumeric characters, and "_", ".", "-".');
79
+                    throw new \InvalidArgumentException('Invalid service name "' . $value . '". Service names can contain alphanumeric characters, and "_", ".", "-".');
80 80
                 }
81 81
                 return $value;
82 82
             })
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         $default = $proposedTags[0] ?? null;
104 104
         $this->output->writeln("Please choose your $applicationName version.");
105 105
         if (!empty($proposedTags)) {
106
-            $this->output->writeln('Possible values include: <info>'.\implode('</info>, <info>', $proposedTags).'</info>');
106
+            $this->output->writeln('Possible values include: <info>' . \implode('</info>, <info>', $proposedTags) . '</info>');
107 107
         }
108 108
         $this->output->writeln('Enter "v" to view all available versions, "?" for help');
109 109
         $question = new Question(
@@ -111,11 +111,11 @@  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') {
118
-                $this->output->writeln('Available versions: <info>'.\implode('</info>, <info>', $availableVersions).'</info>');
118
+                $this->output->writeln('Available versions: <info>' . \implode('</info>, <info>', $availableVersions) . '</info>');
119 119
                 return 'v';
120 120
             }
121 121
 
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
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         }
94 94
         if ($this->default) {
95 95
             if (!$this->yesNoQuestion) {
96
-                $text .= ' ['.$this->default.']';
96
+                $text .= ' [' . $this->default . ']';
97 97
             } elseif ($this->default === 'y') {
98 98
                 $text .= ' [Y/n]';
99 99
             } elseif ($this->default === 'n') {
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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.');
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
@@ -16,9 +16,9 @@  discard block
 block discarded – undo
16 16
     public function __construct(string $replyDirectory = null)
17 17
     {
18 18
         if ($replyDirectory === null) {
19
-            $replyDirectory = \sys_get_temp_dir().'/replies';
19
+            $replyDirectory = \sys_get_temp_dir() . '/replies';
20 20
         }
21
-        $this->replyDirectory = rtrim($replyDirectory, '/').'/';
21
+        $this->replyDirectory = rtrim($replyDirectory, '/') . '/';
22 22
         if (!\file_exists($replyDirectory)) {
23 23
             \mkdir($replyDirectory, 0777, true);
24 24
         }
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function clear(): void
31 31
     {
32
-        $files = glob($this->replyDirectory.'*'); // get all file names
32
+        $files = glob($this->replyDirectory . '*'); // get all file names
33 33
         foreach ($files as $file) { // iterate files
34 34
             if (is_file($file)) {
35 35
                 unlink($file); // delete file
@@ -40,15 +40,15 @@  discard block
 block discarded – undo
40 40
     private function getNextFileName(): string
41 41
     {
42 42
         $i = 0;
43
-        while (\file_exists($this->replyDirectory.'tmp'.$i)) {
43
+        while (\file_exists($this->replyDirectory . 'tmp' . $i)) {
44 44
             $i++;
45 45
         }
46
-        return 'tmp'.$i;
46
+        return 'tmp' . $i;
47 47
     }
48 48
 
49 49
     public function storeReply(string $payload): void
50 50
     {
51
-        $path = $this->replyDirectory.$this->getNextFileName();
51
+        $path = $this->replyDirectory . $this->getNextFileName();
52 52
         \file_put_contents($path, $payload);
53 53
     }
54 54
 
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
     {
60 60
         $i = 0;
61 61
         $replies = [];
62
-        while (\file_exists($this->replyDirectory.'tmp'.$i)) {
63
-            $content = \file_get_contents($this->replyDirectory.'tmp'.$i);
62
+        while (\file_exists($this->replyDirectory . 'tmp' . $i)) {
63
+            $content = \file_get_contents($this->replyDirectory . 'tmp' . $i);
64 64
             if ($content === false) {
65
-                throw new \RuntimeException('Failed to load file '.$this->replyDirectory.'tmp'.$i);
65
+                throw new \RuntimeException('Failed to load file ' . $this->replyDirectory . 'tmp' . $i);
66 66
             }
67 67
             $replies[] = $content;
68 68
             $i++;
Please login to merge, or discard this patch.