@@ -1,6 +1,6 @@ discard block |
||
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. |
@@ -567,7 +567,7 @@ discard block |
||
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 | } |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | |
632 | 632 | Assertion::allString($files); |
633 | 633 | |
634 | - $normalizePath = function (string $file) use ($basePath, $key): SplFileInfo { |
|
634 | + $normalizePath = function(string $file) use ($basePath, $key): SplFileInfo { |
|
635 | 635 | $file = self::normalizePath($file, $basePath); |
636 | 636 | |
637 | 637 | if (is_link($file)) { |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | Closure $blacklistFilter, |
750 | 750 | array $devPackages |
751 | 751 | ): array { |
752 | - $processFinderConfig = function (stdClass $config) use ($basePath, $blacklistFilter, $devPackages) { |
|
752 | + $processFinderConfig = function(stdClass $config) use ($basePath, $blacklistFilter, $devPackages) { |
|
753 | 753 | return self::processFinder($config, $basePath, $blacklistFilter, $devPackages); |
754 | 754 | }; |
755 | 755 | |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | ->files() |
775 | 775 | ->filter($blacklistFilter) |
776 | 776 | ->filter( |
777 | - function (SplFileInfo $fileInfo) use ($devPackages): bool { |
|
777 | + function(SplFileInfo $fileInfo) use ($devPackages): bool { |
|
778 | 778 | foreach ($devPackages as $devPackage) { |
779 | 779 | if ($devPackage === longest_common_base_path([$devPackage, $fileInfo->getRealPath()])) { |
780 | 780 | // File belongs to the dev package |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | ->ignoreVCS(true) |
789 | 789 | ; |
790 | 790 | |
791 | - $normalizedConfig = (function (array $config, Finder $finder): array { |
|
791 | + $normalizedConfig = (function(array $config, Finder $finder): array { |
|
792 | 792 | $normalizedConfig = []; |
793 | 793 | |
794 | 794 | foreach ($config as $method => $arguments) { |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | return $normalizedConfig; |
810 | 810 | })((array) $config, $finder); |
811 | 811 | |
812 | - $createNormalizedDirectories = function (string $directory) use ($basePath): ?string { |
|
812 | + $createNormalizedDirectories = function(string $directory) use ($basePath): ?string { |
|
813 | 813 | $directory = self::normalizePath($directory, $basePath); |
814 | 814 | |
815 | 815 | if (is_link($directory)) { |
@@ -827,7 +827,7 @@ discard block |
||
827 | 827 | return $directory; |
828 | 828 | }; |
829 | 829 | |
830 | - $normalizeFileOrDirectory = function (string &$fileOrDirectory) use ($basePath): void { |
|
830 | + $normalizeFileOrDirectory = function(string &$fileOrDirectory) use ($basePath): void { |
|
831 | 831 | $fileOrDirectory = self::normalizePath($fileOrDirectory, $basePath); |
832 | 832 | |
833 | 833 | if (is_link($fileOrDirectory)) { |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | $filesToAppend[] = self::normalizePath($vendorDir.'/composer/installed.json', $basePath); |
907 | 907 | |
908 | 908 | $vendorPackages = toArray(values(map( |
909 | - function ($file): string { |
|
909 | + function($file): string { |
|
910 | 910 | // Convert files to string as SplFileInfo is not serializable |
911 | 911 | return (string) $file; |
912 | 912 | }, |
@@ -923,7 +923,7 @@ discard block |
||
923 | 923 | if (null === $decodedJsonContents || false === array_key_exists('autoload', $decodedJsonContents)) { |
924 | 924 | $files = toArray(values(map( |
925 | 925 | /** @param string|SplFileInfo $file */ |
926 | - function ($file): string { |
|
926 | + function($file): string { |
|
927 | 927 | return (string) $file; |
928 | 928 | }, |
929 | 929 | Finder::create() |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | |
935 | 935 | $directories = toArray(values(map( |
936 | 936 | /** @param string|SplFileInfo $file */ |
937 | - function ($file): string { |
|
937 | + function($file): string { |
|
938 | 938 | return (string) $file; |
939 | 939 | }, |
940 | 940 | Finder::create() |
@@ -988,7 +988,7 @@ discard block |
||
988 | 988 | } |
989 | 989 | } |
990 | 990 | |
991 | - $normalizePath = function (string $path) use ($basePath): string { |
|
991 | + $normalizePath = function(string $path) use ($basePath): string { |
|
992 | 992 | return is_absolute_path($path) |
993 | 993 | ? canonicalize($path) |
994 | 994 | : self::normalizePath(trim($path, '/ '), $basePath) |
@@ -1046,7 +1046,7 @@ discard block |
||
1046 | 1046 | array $devPackages |
1047 | 1047 | ): array { |
1048 | 1048 | $relativeDevPackages = array_map( |
1049 | - function (string $packagePath) use ($basePath): string { |
|
1049 | + function(string $packagePath) use ($basePath): string { |
|
1050 | 1050 | return make_path_relative($packagePath, $basePath); |
1051 | 1051 | }, |
1052 | 1052 | $devPackages |
@@ -1083,12 +1083,12 @@ discard block |
||
1083 | 1083 | $excludedPaths = array_unique( |
1084 | 1084 | array_filter( |
1085 | 1085 | array_map( |
1086 | - function (string $path) use ($basePath): string { |
|
1086 | + function(string $path) use ($basePath): string { |
|
1087 | 1087 | return make_path_relative($path, $basePath); |
1088 | 1088 | }, |
1089 | 1089 | $excludedPaths |
1090 | 1090 | ), |
1091 | - function (string $path): bool { |
|
1091 | + function(string $path): bool { |
|
1092 | 1092 | return '..' !== substr($path, 0, 2); |
1093 | 1093 | } |
1094 | 1094 | ) |
@@ -1123,7 +1123,7 @@ discard block |
||
1123 | 1123 | |
1124 | 1124 | $directories = $raw->{$key}; |
1125 | 1125 | |
1126 | - $normalizeDirectory = function (string $directory) use ($basePath, $key): string { |
|
1126 | + $normalizeDirectory = function(string $directory) use ($basePath, $key): string { |
|
1127 | 1127 | $directory = self::normalizePath($directory, $basePath); |
1128 | 1128 | |
1129 | 1129 | if (is_link($directory)) { |
@@ -1167,7 +1167,7 @@ discard block |
||
1167 | 1167 | $compactorClasses = array_unique((array) $raw->compactors); |
1168 | 1168 | |
1169 | 1169 | return array_map( |
1170 | - function (string $class) use ($raw, $basePath): Compactor { |
|
1170 | + function(string $class) use ($raw, $basePath): Compactor { |
|
1171 | 1171 | Assertion::classExists($class, 'The compactor class "%s" does not exist.'); |
1172 | 1172 | Assertion::implementsInterface($class, Compactor::class, 'The class "%s" is not a compactor class.'); |
1173 | 1173 | |
@@ -1257,7 +1257,7 @@ discard block |
||
1257 | 1257 | |
1258 | 1258 | private static function retrieveComposerFiles(string $basePath): array |
1259 | 1259 | { |
1260 | - $retrieveFileAndContents = function (string $file): array { |
|
1260 | + $retrieveFileAndContents = function(string $file): array { |
|
1261 | 1261 | $json = new Json(); |
1262 | 1262 | |
1263 | 1263 | if (false === file_exists($file) || false === is_file($file) || false === is_readable($file)) { |