Passed
Pull Request — master (#146)
by Théo
02:11
created
src/Configuration.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /*
6 6
  * This file is part of the box project.
@@ -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
             }
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
 
630 630
         Assertion::allString($files);
631 631
 
632
-        $normalizePath = function (string $file) use ($basePath, $key): SplFileInfo {
632
+        $normalizePath = function(string $file) use ($basePath, $key): SplFileInfo {
633 633
             $file = self::normalizePath($file, $basePath);
634 634
 
635 635
             if (is_link($file)) {
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
         Closure $blacklistFilter,
748 748
         array $devPackages
749 749
     ): array {
750
-        $processFinderConfig = function (stdClass $config) use ($basePath, $blacklistFilter, $devPackages) {
750
+        $processFinderConfig = function(stdClass $config) use ($basePath, $blacklistFilter, $devPackages) {
751 751
             return self::processFinder($config, $basePath, $blacklistFilter, $devPackages);
752 752
         };
753 753
 
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
             ->files()
773 773
             ->filter($blacklistFilter)
774 774
             ->filter(
775
-                function (SplFileInfo $fileInfo) use ($devPackages): bool {
775
+                function(SplFileInfo $fileInfo) use ($devPackages): bool {
776 776
                     foreach ($devPackages as $devPackage) {
777 777
                         if ($devPackage === longest_common_base_path([$devPackage, $fileInfo->getRealPath()])) {
778 778
                             // File belongs to the dev package
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
             ->ignoreVCS(true)
787 787
         ;
788 788
 
789
-        $normalizedConfig = (function (array $config, Finder $finder): array {
789
+        $normalizedConfig = (function(array $config, Finder $finder): array {
790 790
             $normalizedConfig = [];
791 791
 
792 792
             foreach ($config as $method => $arguments) {
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
             return $normalizedConfig;
808 808
         })((array) $config, $finder);
809 809
 
810
-        $createNormalizedDirectories = function (string $directory) use ($basePath): ?string {
810
+        $createNormalizedDirectories = function(string $directory) use ($basePath): ?string {
811 811
             $directory = self::normalizePath($directory, $basePath);
812 812
 
813 813
             if (is_link($directory)) {
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
             return $directory;
826 826
         };
827 827
 
828
-        $normalizeFileOrDirectory = function (string &$fileOrDirectory) use ($basePath): void {
828
+        $normalizeFileOrDirectory = function(string &$fileOrDirectory) use ($basePath): void {
829 829
             $fileOrDirectory = self::normalizePath($fileOrDirectory, $basePath);
830 830
 
831 831
             if (is_link($fileOrDirectory)) {
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
     ): array {
895 895
         $excludedPaths = array_flip($excludedPaths);
896 896
 
897
-        $toString = function ($file): string {
897
+        $toString = function($file): string {
898 898
             // @param string|SplFileInfo $file
899 899
             return (string) $file;
900 900
         };
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
             }
981 981
         }
982 982
 
983
-        $normalizePath = function (string $path) use ($basePath): string {
983
+        $normalizePath = function(string $path) use ($basePath): string {
984 984
             return is_absolute_path($path)
985 985
                 ? canonicalize($path)
986 986
                 : self::normalizePath(trim($path, '/ '), $basePath)
@@ -1038,7 +1038,7 @@  discard block
 block discarded – undo
1038 1038
         array $devPackages
1039 1039
     ): array {
1040 1040
         $relativeDevPackages = array_map(
1041
-            function (string $packagePath) use ($basePath): string {
1041
+            function(string $packagePath) use ($basePath): string {
1042 1042
                 return make_path_relative($packagePath, $basePath);
1043 1043
             },
1044 1044
             $devPackages
@@ -1104,12 +1104,12 @@  discard block
 block discarded – undo
1104 1104
         $excludedPaths = array_unique(
1105 1105
             array_filter(
1106 1106
                 array_map(
1107
-                    function (string $path) use ($basePath): string {
1107
+                    function(string $path) use ($basePath): string {
1108 1108
                         return make_path_relative($path, $basePath);
1109 1109
                     },
1110 1110
                     $excludedPaths
1111 1111
                 ),
1112
-                function (string $path): bool {
1112
+                function(string $path): bool {
1113 1113
                     return '..' !== substr($path, 0, 2);
1114 1114
                 }
1115 1115
             )
@@ -1144,7 +1144,7 @@  discard block
 block discarded – undo
1144 1144
 
1145 1145
         $directories = $raw->{$key};
1146 1146
 
1147
-        $normalizeDirectory = function (string $directory) use ($basePath, $key): string {
1147
+        $normalizeDirectory = function(string $directory) use ($basePath, $key): string {
1148 1148
             $directory = self::normalizePath($directory, $basePath);
1149 1149
 
1150 1150
             if (is_link($directory)) {
@@ -1188,7 +1188,7 @@  discard block
 block discarded – undo
1188 1188
         $compactorClasses = array_unique((array) $raw->compactors);
1189 1189
 
1190 1190
         return array_map(
1191
-            function (string $class) use ($raw, $basePath): Compactor {
1191
+            function(string $class) use ($raw, $basePath): Compactor {
1192 1192
                 Assertion::classExists($class, 'The compactor class "%s" does not exist.');
1193 1193
                 Assertion::implementsInterface($class, Compactor::class, 'The class "%s" is not a compactor class.');
1194 1194
 
@@ -1278,7 +1278,7 @@  discard block
 block discarded – undo
1278 1278
 
1279 1279
     private static function retrieveComposerFiles(string $basePath): array
1280 1280
     {
1281
-        $retrieveFileAndContents = function (string $file): array {
1281
+        $retrieveFileAndContents = function(string $file): array {
1282 1282
             $json = new Json();
1283 1283
 
1284 1284
             if (false === file_exists($file) || false === is_file($file) || false === is_readable($file)) {
Please login to merge, or discard this patch.