Passed
Pull Request — master (#196)
by Théo
02:31
created
src/Configuration.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1231,7 +1231,7 @@
 block discarded – undo
1231 1231
             return file_exists($configFilePath)
1232 1232
                 ? PhpScoperConfiguration::load($configFilePath)
1233 1233
                 : PhpScoperConfiguration::load()
1234
-             ;
1234
+                ;
1235 1235
         }
1236 1236
 
1237 1237
         $configFile = $raw->phpScoper;
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
     {
568 568
         $blacklist = self::retrieveBlacklist($raw, $basePath, ...$excludedPaths);
569 569
 
570
-        $blacklistFilter = function (SplFileInfo $file) use ($blacklist): ?bool {
570
+        $blacklistFilter = function(SplFileInfo $file) use ($blacklist): ?bool {
571 571
             if ($file->isLink()) {
572 572
                 return false;
573 573
             }
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 
640 640
         Assertion::allString($files);
641 641
 
642
-        $normalizePath = function (string $file) use ($basePath, $key, $mainScriptPath): ?SplFileInfo {
642
+        $normalizePath = function(string $file) use ($basePath, $key, $mainScriptPath): ?SplFileInfo {
643 643
             $file = self::normalizePath($file, $basePath);
644 644
 
645 645
             if (is_link($file)) {
@@ -757,7 +757,7 @@  discard block
 block discarded – undo
757 757
         Closure $blacklistFilter,
758 758
         array $devPackages
759 759
     ): array {
760
-        $processFinderConfig = function (stdClass $config) use ($basePath, $blacklistFilter, $devPackages) {
760
+        $processFinderConfig = function(stdClass $config) use ($basePath, $blacklistFilter, $devPackages) {
761 761
             return self::processFinder($config, $basePath, $blacklistFilter, $devPackages);
762 762
         };
763 763
 
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
             ->files()
783 783
             ->filter($blacklistFilter)
784 784
             ->filter(
785
-                function (SplFileInfo $fileInfo) use ($devPackages): bool {
785
+                function(SplFileInfo $fileInfo) use ($devPackages): bool {
786 786
                     foreach ($devPackages as $devPackage) {
787 787
                         if ($devPackage === longest_common_base_path([$devPackage, $fileInfo->getRealPath()])) {
788 788
                             // File belongs to the dev package
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
             ->ignoreVCS(true)
797 797
         ;
798 798
 
799
-        $normalizedConfig = (function (array $config, Finder $finder): array {
799
+        $normalizedConfig = (function(array $config, Finder $finder): array {
800 800
             $normalizedConfig = [];
801 801
 
802 802
             foreach ($config as $method => $arguments) {
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
             return $normalizedConfig;
818 818
         })((array) $config, $finder);
819 819
 
820
-        $createNormalizedDirectories = function (string $directory) use ($basePath): ?string {
820
+        $createNormalizedDirectories = function(string $directory) use ($basePath): ?string {
821 821
             $directory = self::normalizePath($directory, $basePath);
822 822
 
823 823
             if (is_link($directory)) {
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
             return $directory;
836 836
         };
837 837
 
838
-        $normalizeFileOrDirectory = function (string &$fileOrDirectory) use ($basePath, $blacklistFilter): void {
838
+        $normalizeFileOrDirectory = function(string &$fileOrDirectory) use ($basePath, $blacklistFilter): void {
839 839
             $fileOrDirectory = self::normalizePath($fileOrDirectory, $basePath);
840 840
 
841 841
             if (is_link($fileOrDirectory)) {
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
         array $filesToAppend,
907 907
         array $excludedPaths
908 908
     ): array {
909
-        $toString = function ($file): string {
909
+        $toString = function($file): string {
910 910
             /** @param string|SplFileInfo $file */
911 911
             return (string) $file;
912 912
         };
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
                     ->depth(1)
929 929
                     ->ignoreUnreadableDirs()
930 930
                     ->filter(
931
-                        function (SplFileInfo $fileInfo): ?bool {
931
+                        function(SplFileInfo $fileInfo): ?bool {
932 932
                             if ($fileInfo->isLink()) {
933 933
                                 return false;
934 934
                             }
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
             }
1003 1003
         }
1004 1004
 
1005
-        $normalizePath = function (string $path) use ($basePath): string {
1005
+        $normalizePath = function(string $path) use ($basePath): string {
1006 1006
             return is_absolute_path($path)
1007 1007
                 ? canonicalize($path)
1008 1008
                 : self::normalizePath(trim($path, '/ '), $basePath)
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
         array $devPackages
1062 1062
     ): array {
1063 1063
         $relativeDevPackages = array_map(
1064
-            function (string $packagePath) use ($basePath): string {
1064
+            function(string $packagePath) use ($basePath): string {
1065 1065
                 return make_path_relative($packagePath, $basePath);
1066 1066
             },
1067 1067
             $devPackages
@@ -1137,12 +1137,12 @@  discard block
 block discarded – undo
1137 1137
         $excludedPaths = array_unique(
1138 1138
             array_filter(
1139 1139
                 array_map(
1140
-                    function (string $path) use ($basePath): string {
1140
+                    function(string $path) use ($basePath): string {
1141 1141
                         return make_path_relative($path, $basePath);
1142 1142
                     },
1143 1143
                     $excludedPaths
1144 1144
                 ),
1145
-                function (string $path): bool {
1145
+                function(string $path): bool {
1146 1146
                     return '..' !== substr($path, 0, 2);
1147 1147
                 }
1148 1148
             )
@@ -1177,7 +1177,7 @@  discard block
 block discarded – undo
1177 1177
 
1178 1178
         $directories = $raw->{$key};
1179 1179
 
1180
-        $normalizeDirectory = function (string $directory) use ($basePath, $key): string {
1180
+        $normalizeDirectory = function(string $directory) use ($basePath, $key): string {
1181 1181
             $directory = self::normalizePath($directory, $basePath);
1182 1182
 
1183 1183
             if (is_link($directory)) {
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
         $compactorClasses = array_unique((array) $raw->compactors);
1222 1222
 
1223 1223
         return array_map(
1224
-            function (string $class) use ($raw, $basePath): Compactor {
1224
+            function(string $class) use ($raw, $basePath): Compactor {
1225 1225
                 Assertion::classExists($class, 'The compactor class "%s" does not exist.');
1226 1226
                 Assertion::implementsInterface($class, Compactor::class, 'The class "%s" is not a compactor class.');
1227 1227
 
@@ -1311,7 +1311,7 @@  discard block
 block discarded – undo
1311 1311
 
1312 1312
     private static function retrieveComposerFiles(string $basePath): array
1313 1313
     {
1314
-        $retrieveFileAndContents = function (string $file): array {
1314
+        $retrieveFileAndContents = function(string $file): array {
1315 1315
             $json = new Json();
1316 1316
 
1317 1317
             if (false === file_exists($file) || false === is_file($file) || false === is_readable($file)) {
Please login to merge, or discard this patch.
src/Console/Command/Info.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -411,7 +411,7 @@
 block discarded – undo
411 411
     private function retrieveCompressionCount($phar): array
412 412
     {
413 413
         $count = array_fill_keys(
414
-           self::ALGORITHMS,
414
+            self::ALGORITHMS,
415 415
             0
416 416
         );
417 417
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -427,7 +427,7 @@
 block discarded – undo
427 427
             return $count;
428 428
         }
429 429
 
430
-        $countFile = function (array $count, PharFileInfo $file): array {
430
+        $countFile = function(array $count, PharFileInfo $file): array {
431 431
             if (false === $file->isCompressed()) {
432 432
                 ++$count['None'];
433 433
 
Please login to merge, or discard this patch.
requirement-checker/src/RequirementCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
              *
147 147
              * @return bool
148 148
              */
149
-            function ($checkPassed, Requirement $requirement) {
149
+            function($checkPassed, Requirement $requirement) {
150 150
                 return $checkPassed && $requirement->isFulfilled();
151 151
             },
152 152
             true
Please login to merge, or discard this patch.
requirement-checker/src/Requirement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
             $this->fulfilled = eval($this->checkIsFulfilled);
47 47
         }
48 48
 
49
-        return (bool) $this->fulfilled;  // Cast to boolean, `(bool)` and `boolval()` are not available in PHP 5.3
49
+        return (bool) $this->fulfilled; // Cast to boolean, `(bool)` and `boolval()` are not available in PHP 5.3
50 50
     }
51 51
 
52 52
     /**
Please login to merge, or discard this patch.
scoper.inc.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
 
19 19
 return [
20 20
     'patchers' => [
21
-        function (string $filePath, string $prefix, string $contents): string {
21
+        function(string $filePath, string $prefix, string $contents): string {
22 22
             $finderClass = sprintf('\%s\%s', $prefix, Finder::class);
23 23
 
24 24
             return str_replace($finderClass, '\\'.Finder::class, $contents);
25 25
         },
26
-        function (string $filePath, string $prefix, string $contents): string {
26
+        function(string $filePath, string $prefix, string $contents): string {
27 27
             $file = 'vendor/beberlei/assert/lib/Assert/Assertion.php';
28 28
 
29 29
             if ($filePath !== $file) {
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
                 $contents
40 40
             );
41 41
         },
42
-        function (string $filePath, string $prefix, string $contents): string {
42
+        function(string $filePath, string $prefix, string $contents): string {
43 43
             $files = [
44 44
                 'src/functions.php',
45 45
                 'src/Configuration.php',
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                 $contents
68 68
             );
69 69
         },
70
-        function (string $filePath, string $prefix, string $contents): string {
70
+        function(string $filePath, string $prefix, string $contents): string {
71 71
             if ('vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php' !== $filePath) {
72 72
                 return $contents;
73 73
             }
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
                 $contents
82 82
             );
83 83
         },
84
-        function (string $filePath, string $prefix, string $contents) use ($classLoaderContents): string {
84
+        function(string $filePath, string $prefix, string $contents) use ($classLoaderContents): string {
85 85
             return 'vendor/composer/composer/src/Composer/Autoload/ClassLoader.php' === $filePath ? $classLoaderContents : $contents;
86 86
         },
87
-        function (string $filePath, string $prefix, string $contents): string {
87
+        function(string $filePath, string $prefix, string $contents): string {
88 88
             if ('src/bootstrap.php' !== $filePath) {
89 89
                 return $contents;
90 90
             }
Please login to merge, or discard this patch.
requirement-checker/tests/RequirementTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
         );
99 99
 
100 100
         $this->assertFalse($requirement->isFulfilled());
101
-        $this->assertFalse($requirement->isFulfilled());    // Would have gave `true` if it was evaluated a second time
101
+        $this->assertFalse($requirement->isFulfilled()); // Would have gave `true` if it was evaluated a second time
102 102
 
103 103
         unset($GLOBALS['x']);
104 104
     }
Please login to merge, or discard this patch.
requirement-checker/tests/CheckerTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     {
64 64
         $phpVersion = PHP_VERSION;
65 65
 
66
-        yield (function () use ($phpVersion) {
66
+        yield (function() use ($phpVersion) {
67 67
             return [
68 68
                 new RequirementCollection(),
69 69
                 IO::VERBOSITY_DEBUG,
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             ];
89 89
         })();
90 90
 
91
-        yield (function () use ($phpVersion) {
91
+        yield (function() use ($phpVersion) {
92 92
             return [
93 93
                 new RequirementCollection(),
94 94
                 IO::VERBOSITY_VERY_VERBOSE,
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         })();
115 115
 
116 116
         foreach ([IO::VERBOSITY_VERBOSE, IO::VERBOSITY_NORMAL, IO::VERBOSITY_QUIET] as $verbosity) {
117
-            yield (function () use ($verbosity) {
117
+            yield (function() use ($verbosity) {
118 118
                 return [
119 119
                     new RequirementCollection(),
120 120
                     $verbosity,
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             })();
125 125
         }
126 126
 
127
-        yield (function () use ($phpVersion) {
127
+        yield (function() use ($phpVersion) {
128 128
             $requirements = new RequirementCollection();
129 129
 
130 130
             $requirements->addRequirement(
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
             ];
165 165
         })();
166 166
 
167
-        yield (function () use ($phpVersion) {
167
+        yield (function() use ($phpVersion) {
168 168
             $requirements = new RequirementCollection();
169 169
 
170 170
             $requirements->addRequirement(
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         })();
205 205
 
206 206
         foreach ([IO::VERBOSITY_VERBOSE, IO::VERBOSITY_NORMAL, IO::VERBOSITY_QUIET] as $verbosity) {
207
-            yield (function () use ($verbosity) {
207
+            yield (function() use ($verbosity) {
208 208
                 $requirements = new RequirementCollection();
209 209
 
210 210
                 $requirements->addRequirement(
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
             })();
228 228
         }
229 229
 
230
-        yield (function () use ($phpVersion) {
230
+        yield (function() use ($phpVersion) {
231 231
             $requirements = new RequirementCollection();
232 232
 
233 233
             $requirements->addRequirement(
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
         })();
276 276
 
277 277
         foreach ([IO::VERBOSITY_VERY_VERBOSE, IO::VERBOSITY_VERBOSE, IO::VERBOSITY_NORMAL] as $verbosity) {
278
-            yield (function () use ($verbosity, $phpVersion) {
278
+            yield (function() use ($verbosity, $phpVersion) {
279 279
                 $requirements = new RequirementCollection();
280 280
 
281 281
                 $requirements->addRequirement(
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
             })();
322 322
         }
323 323
 
324
-        yield (function () use ($phpVersion) {
324
+        yield (function() use ($phpVersion) {
325 325
             $requirements = new RequirementCollection();
326 326
 
327 327
             $requirements->addRequirement(
Please login to merge, or discard this patch.
src/Composer/ComposerConfiguration.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
         return array_filter(
59 59
             array_map(
60
-                function (string $packageName) use ($vendorDir): ?string {
60
+                function(string $packageName) use ($vendorDir): ?string {
61 61
                     $realPath = realpath($vendorDir.DIRECTORY_SEPARATOR.$packageName);
62 62
 
63 63
                     return false !== $realPath ? $realPath : null;
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         }
91 91
 
92 92
         return array_map(
93
-            function (array $package): string {
93
+            function(array $package): string {
94 94
                 return $package['name'];
95 95
             },
96 96
             $composerLockDecodedContents['packages-dev']
Please login to merge, or discard this patch.
src/Json/Json.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
             }
57 57
         }
58 58
 
59
-        return false === $assoc ? (object) $data : $data;   // If JSON is an empty JSON json_decode returns an empty
59
+        return false === $assoc ? (object) $data : $data; // If JSON is an empty JSON json_decode returns an empty
60 60
                                                             // array instead of an stdClass instance
61 61
     }
62 62
 
Please login to merge, or discard this patch.