Completed
Pull Request — master (#104)
by David
04:40
created
src/Service/Volume/TmpfsVolume.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
             'type' => $this->getType(),
28 28
             'source' => $this->source,
29 29
             'comment' => $this->comment,
30
-        ], function ($v) {
30
+        ], function($v) {
31 31
             return null !== $v;
32 32
         });
33 33
     }
Please login to merge, or discard this patch.
src/Service/Volume/NamedVolume.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
             'readOnly' => $this->readOnly,
58 58
             'comment' => $this->comment,
59 59
             'requestStorage' => $this->requestStorage,
60
-        ], function ($v) {
60
+        ], function($v) {
61 61
             return null !== $v;
62 62
         });
63 63
     }
Please login to merge, or discard this patch.
src/Service/Volume/BindVolume.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
             'target' => $this->target,
50 50
             'readOnly' => $this->readOnly,
51 51
             'comment' => $this->comment
52
-        ], function ($v) {
52
+        ], function($v) {
53 53
             return null !== $v;
54 54
         });
55 55
     }
Please login to merge, or discard this patch.
src/Docker/ImageService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             $config = $this->docker->imageInspect($imageName)->getConfig();
68 68
         }
69 69
         if ($config === null) {
70
-            throw new AenthillException('Cannot inspect container '.$imageName.'. Missing config key.');
70
+            throw new AenthillException('Cannot inspect container ' . $imageName . '. Missing config key.');
71 71
         }
72 72
         return $config;
73 73
     }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             'fromImage' => $imageName
89 89
         ]);
90 90
 
91
-        $result->onFrame(function (CreateImageInfo $frame) {
91
+        $result->onFrame(function(CreateImageInfo $frame) {
92 92
             $this->logger->info($frame->getStatus());
93 93
         });
94 94
         $result->wait();
Please login to merge, or discard this patch.
tests/Docker/ImageServiceTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 
16 16
         try {
17 17
             $imageService->rmi('busybox:1.29.2');
18
-        } catch(ImageDeleteNotFoundException $e) {
18
+        } catch (ImageDeleteNotFoundException $e) {
19 19
             // Try to delete. If this fails, it's ok.
20 20
         }
21 21
 
Please login to merge, or discard this patch.
src/Yaml/Dumper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     {
64 64
         if ($input instanceof CommentedItem) {
65 65
             //$comment = $input->getComment();
66
-            $output = '# '.$input->getComment()."\n";
66
+            $output = '# ' . $input->getComment() . "\n";
67 67
             $input = $input->getItem();
68 68
         } else {
69 69
             //$comment = null;
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         }
80 80
 
81 81
         if ($inline <= 0 || (!\is_array($input) && $dumpObjectAsInlineMap) || empty($input)) {
82
-            $output .= $prefix.Inline::dump($input, $flags);
82
+            $output .= $prefix . Inline::dump($input, $flags);
83 83
         } else {
84 84
             $dumpAsMap = Inline::isHash($input);
85 85
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                     // If the first line starts with a space character, the spec requires a blockIndicationIndicator
96 96
                     // http://www.yaml.org/spec/1.2/spec.html#id2793979
97 97
                     $blockIndentationIndicator = (' ' === substr($value, 0, 1)) ? (string) $this->indentation : '';
98
-                    $output .= sprintf("%s%s%s |%s\n", $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', '', $blockIndentationIndicator);
98
+                    $output .= sprintf("%s%s%s |%s\n", $prefix, $dumpAsMap ? Inline::dump($key, $flags) . ':' : '-', '', $blockIndentationIndicator);
99 99
 
100 100
                     $pregSplit = preg_split('/\n|\r\n/', $value);
101 101
                     foreach ($pregSplit as $row) {
@@ -119,10 +119,10 @@  discard block
 block discarded – undo
119 119
                 $output .= sprintf(
120 120
                     '%s%s%s%s',
121 121
                     $prefix,
122
-                    $dumpAsMap ? Inline::dump($key, $flags).':' : '-',
122
+                    $dumpAsMap ? Inline::dump($key, $flags) . ':' : '-',
123 123
                     $willBeInlined ? ' ' : "\n",
124 124
                     $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $flags)
125
-                ).($willBeInlined ? "\n" : '');
125
+                ) . ($willBeInlined ? "\n" : '');
126 126
             }
127 127
         }
128 128
 
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
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     public function filterBestTags(array $tags): array
22 22
     {
23 23
         // filter numeric versions only
24
-        $versions = \array_filter($tags, function (string $tag) {
24
+        $versions = \array_filter($tags, function(string $tag) {
25 25
             return preg_match('/^\d+(\.\d+)*$/', $tag);
26 26
         });
27 27
 
Please login to merge, or discard this patch.
src/Question/CommonValidators.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public static function getAlphaValidator(?array $additionalCharacters = null, ?string $hint = null): \Closure
15 15
     {
16
-        return function (string $value) use ($additionalCharacters, $hint) {
16
+        return function(string $value) use ($additionalCharacters, $hint) {
17 17
             $value = trim($value);
18 18
             $pattern = '/^[a-zA-Z0-9';
19 19
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
     public static function getAbsolutePathValidator(): \Closure
41 41
     {
42
-        return function (string $value) {
42
+        return function(string $value) {
43 43
             $value = trim($value);
44 44
             if (!preg_match('/^[\'"]?(?:\/[^\/\n]+)*[\'"]?$/', $value)) {
45 45
                 throw new \InvalidArgumentException('Invalid value "' . $value . '". Hint: path has to be absolute without trailing "/".');
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
     public static function getDomainNameValidator(): \Closure
52 52
     {
53
-        return function (string $value) {
53
+        return function(string $value) {
54 54
             $value = trim($value);
55 55
             if (!preg_match('/^(?!:\/\/)([a-zA-Z0-9-_]+\.)*[a-zA-Z0-9][a-zA-Z0-9-_]+\.[a-zA-Z]{2,11}?$/im', $value)) {
56 56
                 throw new \InvalidArgumentException('Invalid value "' . $value . '". Hint: the domain name must not start with "http(s)://".');
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
     public static function getDomainNameWithPortValidator(): \Closure
63 63
     {
64
-        return function (string $value) {
64
+        return function(string $value) {
65 65
             $value = trim($value);
66 66
             if (!preg_match('/^(?!:\/\/)([a-zA-Z0-9-_]+\.)*[a-zA-Z0-9][a-zA-Z0-9-_]+\.[a-zA-Z]{2,11}?:\d*$/im', $value)) {
67 67
                 throw new \InvalidArgumentException('Invalid value "' . $value . '". Hint: the domain name must not start with "http(s)://".');
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
     public static function getIPv4Validator(): \Closure
74 74
     {
75
-        return function (string $value) {
75
+        return function(string $value) {
76 76
             $value = trim($value);
77 77
             if (!preg_match('/^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$/', $value)) {
78 78
                 throw new \InvalidArgumentException('Invalid value "' . $value . '".');
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
     public static function getDockerImageWithoutTagValidator(): \Closure
85 85
     {
86
-        return function (string $value) {
86
+        return function(string $value) {
87 87
             $value = trim($value);
88 88
             if (!preg_match('/^[a-z0-9]+\/([a-z0-9]+(?:[._-][a-z0-9]+)*)$/', $value)) {
89 89
                 throw new \InvalidArgumentException('Invalid value "' . $value . '". Hint: the docker image should be of type "username/repository"');
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
     public static function getDockerImageWithTagValidator(): \Closure
96 96
     {
97
-        return function (string $value) {
97
+        return function(string $value) {
98 98
             $value = trim($value);
99 99
             if (!preg_match('/^[a-z0-9]+\/([a-z0-9]+(?:[._-][a-z0-9]+)*)(:[\w]+([\w._-]+)?)$/', $value)) {
100 100
                 throw new \InvalidArgumentException('Invalid value "' . $value . '". Hint: the docker image should be of type "username/repository:tag"');
Please login to merge, or discard this patch.
src/Service/Service.php 1 patch
Spacing   +8 added lines, -9 removed lines patch added patch discarded remove patch
@@ -131,13 +131,12 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public function jsonSerialize(): array
133 133
     {
134
-        $labelMap = function (CommentedItem $commentedItem): array {
134
+        $labelMap = function(CommentedItem $commentedItem): array {
135 135
             return null === $commentedItem->getComment() ?
136
-                ['value' => $commentedItem->getItem()] :
137
-                ['value' => $commentedItem->getItem(), 'comment' => $commentedItem->getComment()];
136
+                ['value' => $commentedItem->getItem()] : ['value' => $commentedItem->getItem(), 'comment' => $commentedItem->getComment()];
138 137
         };
139 138
 
140
-        $jsonSerializeMap = function (\JsonSerializable $obj): array {
139
+        $jsonSerializeMap = function(\JsonSerializable $obj): array {
141 140
             return $obj->jsonSerialize();
142 141
         };
143 142
 
@@ -172,13 +171,13 @@  discard block
 block discarded – undo
172 171
             'requests' => array_filter([
173 172
                 'memory' => $this->requestMemory,
174 173
                 'cpu' => $this->requestCpu,
175
-            ], function ($v) {
174
+            ], function($v) {
176 175
                 return null !== $v;
177 176
             }),
178 177
             'limits' => array_filter([
179 178
                 'memory' => $this->limitMemory,
180 179
                 'cpu' => $this->limitCpu,
181
-            ], function ($v) {
180
+            ], function($v) {
182 181
                 return null !== $v;
183 182
             }),
184 183
         ]);
@@ -416,7 +415,7 @@  discard block
 block discarded – undo
416 415
             'source' => $source,
417 416
             'target' => $target,
418 417
             'comment' => $comment,
419
-        ], function ($v) {
418
+        ], function($v) {
420 419
             return null !== $v;
421 420
         });
422 421
     }
@@ -590,7 +589,7 @@  discard block
 block discarded – undo
590 589
 
591 590
     private function removeVolumesByType(string $type): void
592 591
     {
593
-        $filterFunction = function (Volume $vol) use ($type) {
592
+        $filterFunction = function(Volume $vol) use ($type) {
594 593
             return $vol->getType() !== $type;
595 594
         };
596 595
         $this->volumes = array_values(array_filter($this->volumes, $filterFunction));
@@ -613,7 +612,7 @@  discard block
 block discarded – undo
613 612
 
614 613
     public function removeVolumesBySource(string $source): void
615 614
     {
616
-        $filterFunction = function (Volume $vol) use ($source) {
615
+        $filterFunction = function(Volume $vol) use ($source) {
617 616
             return $vol->getSource() !== $source;
618 617
         };
619 618
         $this->volumes = array_values(array_filter($this->volumes, $filterFunction));
Please login to merge, or discard this patch.