@@ -565,7 +565,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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)) { |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | array $filesToAppend, |
905 | 905 | array $excludedPaths |
906 | 906 | ): array { |
907 | - $toString = function ($file): string { |
|
907 | + $toString = function($file): string { |
|
908 | 908 | // @param string|SplFileInfo $file |
909 | 909 | return (string) $file; |
910 | 910 | }; |
@@ -926,7 +926,7 @@ discard block |
||
926 | 926 | ->depth(1) |
927 | 927 | ->ignoreUnreadableDirs() |
928 | 928 | ->filter( |
929 | - function (SplFileInfo $fileInfo): ?bool { |
|
929 | + function(SplFileInfo $fileInfo): ?bool { |
|
930 | 930 | if ($fileInfo->isLink()) { |
931 | 931 | return false; |
932 | 932 | } |
@@ -1000,7 +1000,7 @@ discard block |
||
1000 | 1000 | } |
1001 | 1001 | } |
1002 | 1002 | |
1003 | - $normalizePath = function (string $path) use ($basePath): string { |
|
1003 | + $normalizePath = function(string $path) use ($basePath): string { |
|
1004 | 1004 | return is_absolute_path($path) |
1005 | 1005 | ? canonicalize($path) |
1006 | 1006 | : self::normalizePath(trim($path, '/ '), $basePath) |
@@ -1059,7 +1059,7 @@ discard block |
||
1059 | 1059 | array $devPackages |
1060 | 1060 | ): array { |
1061 | 1061 | $relativeDevPackages = array_map( |
1062 | - function (string $packagePath) use ($basePath): string { |
|
1062 | + function(string $packagePath) use ($basePath): string { |
|
1063 | 1063 | return make_path_relative($packagePath, $basePath); |
1064 | 1064 | }, |
1065 | 1065 | $devPackages |
@@ -1135,12 +1135,12 @@ discard block |
||
1135 | 1135 | $excludedPaths = array_unique( |
1136 | 1136 | array_filter( |
1137 | 1137 | array_map( |
1138 | - function (string $path) use ($basePath): string { |
|
1138 | + function(string $path) use ($basePath): string { |
|
1139 | 1139 | return make_path_relative($path, $basePath); |
1140 | 1140 | }, |
1141 | 1141 | $excludedPaths |
1142 | 1142 | ), |
1143 | - function (string $path): bool { |
|
1143 | + function(string $path): bool { |
|
1144 | 1144 | return '..' !== substr($path, 0, 2); |
1145 | 1145 | } |
1146 | 1146 | ) |
@@ -1175,7 +1175,7 @@ discard block |
||
1175 | 1175 | |
1176 | 1176 | $directories = $raw->{$key}; |
1177 | 1177 | |
1178 | - $normalizeDirectory = function (string $directory) use ($basePath, $key): string { |
|
1178 | + $normalizeDirectory = function(string $directory) use ($basePath, $key): string { |
|
1179 | 1179 | $directory = self::normalizePath($directory, $basePath); |
1180 | 1180 | |
1181 | 1181 | if (is_link($directory)) { |
@@ -1219,7 +1219,7 @@ discard block |
||
1219 | 1219 | $compactorClasses = array_unique((array) $raw->compactors); |
1220 | 1220 | |
1221 | 1221 | return array_map( |
1222 | - function (string $class) use ($raw, $basePath): Compactor { |
|
1222 | + function(string $class) use ($raw, $basePath): Compactor { |
|
1223 | 1223 | Assertion::classExists($class, 'The compactor class "%s" does not exist.'); |
1224 | 1224 | Assertion::implementsInterface($class, Compactor::class, 'The class "%s" is not a compactor class.'); |
1225 | 1225 | |
@@ -1309,7 +1309,7 @@ discard block |
||
1309 | 1309 | |
1310 | 1310 | private static function retrieveComposerFiles(string $basePath): array |
1311 | 1311 | { |
1312 | - $retrieveFileAndContents = function (string $file): array { |
|
1312 | + $retrieveFileAndContents = function(string $file): array { |
|
1313 | 1313 | $json = new Json(); |
1314 | 1314 | |
1315 | 1315 | if (false === file_exists($file) || false === is_file($file) || false === is_readable($file)) { |