@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | { |
| 597 | 597 | $blacklist = self::retrieveBlacklist($raw, $basePath, ...$excludedPaths); |
| 598 | 598 | |
| 599 | - $blacklistFilter = function (SplFileInfo $file) use ($blacklist): ?bool { |
|
| 599 | + $blacklistFilter = function(SplFileInfo $file) use ($blacklist): ?bool { |
|
| 600 | 600 | if ($file->isLink()) { |
| 601 | 601 | return false; |
| 602 | 602 | } |
@@ -668,7 +668,7 @@ discard block |
||
| 668 | 668 | |
| 669 | 669 | Assertion::allString($files); |
| 670 | 670 | |
| 671 | - $normalizePath = function (string $file) use ($basePath, $key, $mainScriptPath): ?SplFileInfo { |
|
| 671 | + $normalizePath = function(string $file) use ($basePath, $key, $mainScriptPath): ?SplFileInfo { |
|
| 672 | 672 | $file = self::normalizePath($file, $basePath); |
| 673 | 673 | |
| 674 | 674 | if (is_link($file)) { |
@@ -786,7 +786,7 @@ discard block |
||
| 786 | 786 | Closure $blacklistFilter, |
| 787 | 787 | array $devPackages |
| 788 | 788 | ): array { |
| 789 | - $processFinderConfig = function (stdClass $config) use ($basePath, $blacklistFilter, $devPackages) { |
|
| 789 | + $processFinderConfig = function(stdClass $config) use ($basePath, $blacklistFilter, $devPackages) { |
|
| 790 | 790 | return self::processFinder($config, $basePath, $blacklistFilter, $devPackages); |
| 791 | 791 | }; |
| 792 | 792 | |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | ->files() |
| 812 | 812 | ->filter($blacklistFilter) |
| 813 | 813 | ->filter( |
| 814 | - function (SplFileInfo $fileInfo) use ($devPackages): bool { |
|
| 814 | + function(SplFileInfo $fileInfo) use ($devPackages): bool { |
|
| 815 | 815 | foreach ($devPackages as $devPackage) { |
| 816 | 816 | if ($devPackage === longest_common_base_path([$devPackage, $fileInfo->getRealPath()])) { |
| 817 | 817 | // File belongs to the dev package |
@@ -825,7 +825,7 @@ discard block |
||
| 825 | 825 | ->ignoreVCS(true) |
| 826 | 826 | ; |
| 827 | 827 | |
| 828 | - $normalizedConfig = (function (array $config, Finder $finder): array { |
|
| 828 | + $normalizedConfig = (function(array $config, Finder $finder): array { |
|
| 829 | 829 | $normalizedConfig = []; |
| 830 | 830 | |
| 831 | 831 | foreach ($config as $method => $arguments) { |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | return $normalizedConfig; |
| 847 | 847 | })((array) $config, $finder); |
| 848 | 848 | |
| 849 | - $createNormalizedDirectories = function (string $directory) use ($basePath): ?string { |
|
| 849 | + $createNormalizedDirectories = function(string $directory) use ($basePath): ?string { |
|
| 850 | 850 | $directory = self::normalizePath($directory, $basePath); |
| 851 | 851 | |
| 852 | 852 | if (is_link($directory)) { |
@@ -864,7 +864,7 @@ discard block |
||
| 864 | 864 | return $directory; |
| 865 | 865 | }; |
| 866 | 866 | |
| 867 | - $normalizeFileOrDirectory = function (string &$fileOrDirectory) use ($basePath, $blacklistFilter): void { |
|
| 867 | + $normalizeFileOrDirectory = function(string &$fileOrDirectory) use ($basePath, $blacklistFilter): void { |
|
| 868 | 868 | $fileOrDirectory = self::normalizePath($fileOrDirectory, $basePath); |
| 869 | 869 | |
| 870 | 870 | if (is_link($fileOrDirectory)) { |
@@ -935,7 +935,7 @@ discard block |
||
| 935 | 935 | array $filesToAppend, |
| 936 | 936 | array $excludedPaths |
| 937 | 937 | ): array { |
| 938 | - $toString = function ($file): string { |
|
| 938 | + $toString = function($file): string { |
|
| 939 | 939 | // @param string|SplFileInfo $file |
| 940 | 940 | return (string) $file; |
| 941 | 941 | }; |
@@ -963,7 +963,7 @@ discard block |
||
| 963 | 963 | ->depth(1) |
| 964 | 964 | ->ignoreUnreadableDirs() |
| 965 | 965 | ->filter( |
| 966 | - function (SplFileInfo $fileInfo): ?bool { |
|
| 966 | + function(SplFileInfo $fileInfo): ?bool { |
|
| 967 | 967 | if ($fileInfo->isLink()) { |
| 968 | 968 | return false; |
| 969 | 969 | } |
@@ -1037,7 +1037,7 @@ discard block |
||
| 1037 | 1037 | } |
| 1038 | 1038 | } |
| 1039 | 1039 | |
| 1040 | - $normalizePath = function (string $path) use ($basePath): string { |
|
| 1040 | + $normalizePath = function(string $path) use ($basePath): string { |
|
| 1041 | 1041 | return is_absolute_path($path) |
| 1042 | 1042 | ? canonicalize($path) |
| 1043 | 1043 | : self::normalizePath(trim($path, '/ '), $basePath) |
@@ -1101,7 +1101,7 @@ discard block |
||
| 1101 | 1101 | array $devPackages |
| 1102 | 1102 | ): array { |
| 1103 | 1103 | $relativeDevPackages = array_map( |
| 1104 | - function (string $packagePath) use ($basePath): string { |
|
| 1104 | + function(string $packagePath) use ($basePath) : string { |
|
| 1105 | 1105 | return make_path_relative($packagePath, $basePath); |
| 1106 | 1106 | }, |
| 1107 | 1107 | $devPackages |
@@ -1180,12 +1180,12 @@ discard block |
||
| 1180 | 1180 | $excludedPaths = array_unique( |
| 1181 | 1181 | array_filter( |
| 1182 | 1182 | array_map( |
| 1183 | - function (string $path) use ($basePath): string { |
|
| 1183 | + function(string $path) use ($basePath): string { |
|
| 1184 | 1184 | return make_path_relative($path, $basePath); |
| 1185 | 1185 | }, |
| 1186 | 1186 | $excludedPaths |
| 1187 | 1187 | ), |
| 1188 | - function (string $path): bool { |
|
| 1188 | + function(string $path): bool { |
|
| 1189 | 1189 | return '..' !== substr($path, 0, 2); |
| 1190 | 1190 | } |
| 1191 | 1191 | ) |
@@ -1220,7 +1220,7 @@ discard block |
||
| 1220 | 1220 | |
| 1221 | 1221 | $directories = $raw->{$key}; |
| 1222 | 1222 | |
| 1223 | - $normalizeDirectory = function (string $directory) use ($basePath, $key): string { |
|
| 1223 | + $normalizeDirectory = function(string $directory) use ($basePath, $key): string { |
|
| 1224 | 1224 | $directory = self::normalizePath($directory, $basePath); |
| 1225 | 1225 | |
| 1226 | 1226 | if (is_link($directory)) { |
@@ -1274,7 +1274,7 @@ discard block |
||
| 1274 | 1274 | $compactorClasses = array_unique((array) $raw->compactors); |
| 1275 | 1275 | |
| 1276 | 1276 | return array_map( |
| 1277 | - function (string $class) use ($raw, $basePath): Compactor { |
|
| 1277 | + function(string $class) use ($raw, $basePath): Compactor { |
|
| 1278 | 1278 | Assertion::classExists($class, 'The compactor class "%s" does not exist.'); |
| 1279 | 1279 | Assertion::implementsInterface($class, Compactor::class, 'The class "%s" is not a compactor class.'); |
| 1280 | 1280 | |
@@ -1382,7 +1382,7 @@ discard block |
||
| 1382 | 1382 | |
| 1383 | 1383 | private static function retrieveComposerFiles(string $basePath): array |
| 1384 | 1384 | { |
| 1385 | - $retrieveFileAndContents = function (string $file): array { |
|
| 1385 | + $retrieveFileAndContents = function(string $file): array { |
|
| 1386 | 1386 | $json = new Json(); |
| 1387 | 1387 | |
| 1388 | 1388 | if (false === file_exists($file) || false === is_file($file) || false === is_readable($file)) { |