Passed
Push — master ( e69713...74c243 )
by Théo
02:33
created
src/bootstrap.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 use function unlink;
28 28
 
29 29
 // TODO: update PHP-Scoper to get rid of this horrible hack at some point
30
-$findPhpScoperFunctions = function (): void {
30
+$findPhpScoperFunctions = function(): void {
31 31
     if (file_exists($autoload = __DIR__.'/../../php-scoper/src/functions.php')) {
32 32
         // Is installed via Composer
33 33
         require_once $autoload;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
         $autoload = 'phar://'.\PHAR_COPY.'/vendor/humbug/php-scoper/src/functions.php';
59 59
 
60
-        register_shutdown_function(static function (): void {
60
+        register_shutdown_function(static function(): void {
61 61
             @unlink(\PHAR_COPY);
62 62
         });
63 63
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     throw new RuntimeException('Unable to find the PHP-Scoper functions.');
70 70
 };
71 71
 
72
-$GLOBALS['_BOX_BOOTSTRAP'] = function () use ($findPhpScoperFunctions): void {
72
+$GLOBALS['_BOX_BOOTSTRAP'] = function() use ($findPhpScoperFunctions): void {
73 73
     $findPhpScoperFunctions();
74 74
 
75 75
     \KevinGH\Box\register_aliases();
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 // Convert errors to exceptions
80 80
 set_error_handler(
81
-    function ($code, $message, $file, $line): void {
81
+    function($code, $message, $file, $line): void {
82 82
         if (error_reporting() & $code) {
83 83
             throw new ErrorException($message, 0, $code, $file, $line);
84 84
         }
Please login to merge, or discard this patch.
src/Configuration.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
     {
566 566
         $blacklist = self::retrieveBlacklist($raw, $basePath, ...$excludedPaths);
567 567
 
568
-        $blacklistFilter = function (SplFileInfo $file) use ($blacklist): ?bool {
568
+        $blacklistFilter = function(SplFileInfo $file) use ($blacklist): ?bool {
569 569
             if ($file->isLink()) {
570 570
                 return false;
571 571
             }
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
 
638 638
         Assertion::allString($files);
639 639
 
640
-        $normalizePath = function (string $file) use ($basePath, $key, $mainScriptPath): ?SplFileInfo {
640
+        $normalizePath = function(string $file) use ($basePath, $key, $mainScriptPath): ?SplFileInfo {
641 641
             $file = self::normalizePath($file, $basePath);
642 642
 
643 643
             if (is_link($file)) {
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
         Closure $blacklistFilter,
756 756
         array $devPackages
757 757
     ): array {
758
-        $processFinderConfig = function (stdClass $config) use ($basePath, $blacklistFilter, $devPackages) {
758
+        $processFinderConfig = function(stdClass $config) use ($basePath, $blacklistFilter, $devPackages) {
759 759
             return self::processFinder($config, $basePath, $blacklistFilter, $devPackages);
760 760
         };
761 761
 
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
             ->files()
781 781
             ->filter($blacklistFilter)
782 782
             ->filter(
783
-                function (SplFileInfo $fileInfo) use ($devPackages): bool {
783
+                function(SplFileInfo $fileInfo) use ($devPackages): bool {
784 784
                     foreach ($devPackages as $devPackage) {
785 785
                         if ($devPackage === longest_common_base_path([$devPackage, $fileInfo->getRealPath()])) {
786 786
                             // File belongs to the dev package
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
             ->ignoreVCS(true)
795 795
         ;
796 796
 
797
-        $normalizedConfig = (function (array $config, Finder $finder): array {
797
+        $normalizedConfig = (function(array $config, Finder $finder): array {
798 798
             $normalizedConfig = [];
799 799
 
800 800
             foreach ($config as $method => $arguments) {
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
             return $normalizedConfig;
816 816
         })((array) $config, $finder);
817 817
 
818
-        $createNormalizedDirectories = function (string $directory) use ($basePath): ?string {
818
+        $createNormalizedDirectories = function(string $directory) use ($basePath): ?string {
819 819
             $directory = self::normalizePath($directory, $basePath);
820 820
 
821 821
             if (is_link($directory)) {
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
             return $directory;
834 834
         };
835 835
 
836
-        $normalizeFileOrDirectory = function (string &$fileOrDirectory) use ($basePath, $blacklistFilter): void {
836
+        $normalizeFileOrDirectory = function(string &$fileOrDirectory) use ($basePath, $blacklistFilter): void {
837 837
             $fileOrDirectory = self::normalizePath($fileOrDirectory, $basePath);
838 838
 
839 839
             if (is_link($fileOrDirectory)) {
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
     ): array {
907 907
         $excludedPaths = array_flip($excludedPaths);
908 908
 
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)
@@ -1060,7 +1060,7 @@  discard block
 block discarded – undo
1060 1060
         array $devPackages
1061 1061
     ): array {
1062 1062
         $relativeDevPackages = array_map(
1063
-            function (string $packagePath) use ($basePath): string {
1063
+            function(string $packagePath) use ($basePath): string {
1064 1064
                 return make_path_relative($packagePath, $basePath);
1065 1065
             },
1066 1066
             $devPackages
@@ -1149,12 +1149,12 @@  discard block
 block discarded – undo
1149 1149
         $excludedPaths = array_unique(
1150 1150
             array_filter(
1151 1151
                 array_map(
1152
-                    function (string $path) use ($basePath): string {
1152
+                    function(string $path) use ($basePath): string {
1153 1153
                         return make_path_relative($path, $basePath);
1154 1154
                     },
1155 1155
                     $excludedPaths
1156 1156
                 ),
1157
-                function (string $path): bool {
1157
+                function(string $path): bool {
1158 1158
                     return '..' !== substr($path, 0, 2);
1159 1159
                 }
1160 1160
             )
@@ -1189,7 +1189,7 @@  discard block
 block discarded – undo
1189 1189
 
1190 1190
         $directories = $raw->{$key};
1191 1191
 
1192
-        $normalizeDirectory = function (string $directory) use ($basePath, $key): string {
1192
+        $normalizeDirectory = function(string $directory) use ($basePath, $key): string {
1193 1193
             $directory = self::normalizePath($directory, $basePath);
1194 1194
 
1195 1195
             if (is_link($directory)) {
@@ -1233,7 +1233,7 @@  discard block
 block discarded – undo
1233 1233
         $compactorClasses = array_unique((array) $raw->compactors);
1234 1234
 
1235 1235
         return array_map(
1236
-            function (string $class) use ($raw, $basePath): Compactor {
1236
+            function(string $class) use ($raw, $basePath): Compactor {
1237 1237
                 Assertion::classExists($class, 'The compactor class "%s" does not exist.');
1238 1238
                 Assertion::implementsInterface($class, Compactor::class, 'The class "%s" is not a compactor class.');
1239 1239
 
@@ -1323,7 +1323,7 @@  discard block
 block discarded – undo
1323 1323
 
1324 1324
     private static function retrieveComposerFiles(string $basePath): array
1325 1325
     {
1326
-        $retrieveFileAndContents = function (string $file): array {
1326
+        $retrieveFileAndContents = function(string $file): array {
1327 1327
             $json = new Json();
1328 1328
 
1329 1329
             if (false === file_exists($file) || false === is_file($file) || false === is_readable($file)) {
Please login to merge, or discard this patch.