@@ -1231,7 +1231,7 @@ |
||
1231 | 1231 | return file_exists($configFilePath) |
1232 | 1232 | ? PhpScoperConfiguration::load($configFilePath) |
1233 | 1233 | : PhpScoperConfiguration::load() |
1234 | - ; |
|
1234 | + ; |
|
1235 | 1235 | } |
1236 | 1236 | |
1237 | 1237 | $configFile = $raw->phpScoper; |
@@ -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)) { |
@@ -411,7 +411,7 @@ |
||
411 | 411 | private function retrieveCompressionCount($phar): array |
412 | 412 | { |
413 | 413 | $count = array_fill_keys( |
414 | - self::ALGORITHMS, |
|
414 | + self::ALGORITHMS, |
|
415 | 415 | 0 |
416 | 416 | ); |
417 | 417 |
@@ -427,7 +427,7 @@ |
||
427 | 427 | return $count; |
428 | 428 | } |
429 | 429 | |
430 | - $countFile = function (array $count, PharFileInfo $file): array { |
|
430 | + $countFile = function(array $count, PharFileInfo $file): array { |
|
431 | 431 | if (false === $file->isCompressed()) { |
432 | 432 | ++$count['None']; |
433 | 433 |
@@ -146,7 +146,7 @@ |
||
146 | 146 | * |
147 | 147 | * @return bool |
148 | 148 | */ |
149 | - function ($checkPassed, Requirement $requirement) { |
|
149 | + function($checkPassed, Requirement $requirement) { |
|
150 | 150 | return $checkPassed && $requirement->isFulfilled(); |
151 | 151 | }, |
152 | 152 | true |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | |
19 | 19 | return [ |
20 | 20 | 'patchers' => [ |
21 | - function (string $filePath, string $prefix, string $contents): string { |
|
21 | + function(string $filePath, string $prefix, string $contents): string { |
|
22 | 22 | $finderClass = sprintf('\%s\%s', $prefix, Finder::class); |
23 | 23 | |
24 | 24 | return str_replace($finderClass, '\\'.Finder::class, $contents); |
25 | 25 | }, |
26 | - function (string $filePath, string $prefix, string $contents): string { |
|
26 | + function(string $filePath, string $prefix, string $contents): string { |
|
27 | 27 | $file = 'vendor/beberlei/assert/lib/Assert/Assertion.php'; |
28 | 28 | |
29 | 29 | if ($filePath !== $file) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $contents |
40 | 40 | ); |
41 | 41 | }, |
42 | - function (string $filePath, string $prefix, string $contents): string { |
|
42 | + function(string $filePath, string $prefix, string $contents): string { |
|
43 | 43 | $files = [ |
44 | 44 | 'src/functions.php', |
45 | 45 | 'src/Configuration.php', |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $contents |
68 | 68 | ); |
69 | 69 | }, |
70 | - function (string $filePath, string $prefix, string $contents): string { |
|
70 | + function(string $filePath, string $prefix, string $contents): string { |
|
71 | 71 | if ('vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php' !== $filePath) { |
72 | 72 | return $contents; |
73 | 73 | } |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | $contents |
82 | 82 | ); |
83 | 83 | }, |
84 | - function (string $filePath, string $prefix, string $contents) use ($classLoaderContents): string { |
|
84 | + function(string $filePath, string $prefix, string $contents) use ($classLoaderContents): string { |
|
85 | 85 | return 'vendor/composer/composer/src/Composer/Autoload/ClassLoader.php' === $filePath ? $classLoaderContents : $contents; |
86 | 86 | }, |
87 | - function (string $filePath, string $prefix, string $contents): string { |
|
87 | + function(string $filePath, string $prefix, string $contents): string { |
|
88 | 88 | if ('src/bootstrap.php' !== $filePath) { |
89 | 89 | return $contents; |
90 | 90 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | { |
64 | 64 | $phpVersion = PHP_VERSION; |
65 | 65 | |
66 | - yield (function () use ($phpVersion) { |
|
66 | + yield (function() use ($phpVersion) { |
|
67 | 67 | return [ |
68 | 68 | new RequirementCollection(), |
69 | 69 | IO::VERBOSITY_DEBUG, |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | ]; |
89 | 89 | })(); |
90 | 90 | |
91 | - yield (function () use ($phpVersion) { |
|
91 | + yield (function() use ($phpVersion) { |
|
92 | 92 | return [ |
93 | 93 | new RequirementCollection(), |
94 | 94 | IO::VERBOSITY_VERY_VERBOSE, |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | })(); |
115 | 115 | |
116 | 116 | foreach ([IO::VERBOSITY_VERBOSE, IO::VERBOSITY_NORMAL, IO::VERBOSITY_QUIET] as $verbosity) { |
117 | - yield (function () use ($verbosity) { |
|
117 | + yield (function() use ($verbosity) { |
|
118 | 118 | return [ |
119 | 119 | new RequirementCollection(), |
120 | 120 | $verbosity, |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | })(); |
125 | 125 | } |
126 | 126 | |
127 | - yield (function () use ($phpVersion) { |
|
127 | + yield (function() use ($phpVersion) { |
|
128 | 128 | $requirements = new RequirementCollection(); |
129 | 129 | |
130 | 130 | $requirements->addRequirement( |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | ]; |
165 | 165 | })(); |
166 | 166 | |
167 | - yield (function () use ($phpVersion) { |
|
167 | + yield (function() use ($phpVersion) { |
|
168 | 168 | $requirements = new RequirementCollection(); |
169 | 169 | |
170 | 170 | $requirements->addRequirement( |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | })(); |
205 | 205 | |
206 | 206 | foreach ([IO::VERBOSITY_VERBOSE, IO::VERBOSITY_NORMAL, IO::VERBOSITY_QUIET] as $verbosity) { |
207 | - yield (function () use ($verbosity) { |
|
207 | + yield (function() use ($verbosity) { |
|
208 | 208 | $requirements = new RequirementCollection(); |
209 | 209 | |
210 | 210 | $requirements->addRequirement( |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | })(); |
228 | 228 | } |
229 | 229 | |
230 | - yield (function () use ($phpVersion) { |
|
230 | + yield (function() use ($phpVersion) { |
|
231 | 231 | $requirements = new RequirementCollection(); |
232 | 232 | |
233 | 233 | $requirements->addRequirement( |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | })(); |
276 | 276 | |
277 | 277 | foreach ([IO::VERBOSITY_VERY_VERBOSE, IO::VERBOSITY_VERBOSE, IO::VERBOSITY_NORMAL] as $verbosity) { |
278 | - yield (function () use ($verbosity, $phpVersion) { |
|
278 | + yield (function() use ($verbosity, $phpVersion) { |
|
279 | 279 | $requirements = new RequirementCollection(); |
280 | 280 | |
281 | 281 | $requirements->addRequirement( |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | })(); |
322 | 322 | } |
323 | 323 | |
324 | - yield (function () use ($phpVersion) { |
|
324 | + yield (function() use ($phpVersion) { |
|
325 | 325 | $requirements = new RequirementCollection(); |
326 | 326 | |
327 | 327 | $requirements->addRequirement( |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | return array_filter( |
59 | 59 | array_map( |
60 | - function (string $packageName) use ($vendorDir): ?string { |
|
60 | + function(string $packageName) use ($vendorDir): ?string { |
|
61 | 61 | $realPath = realpath($vendorDir.DIRECTORY_SEPARATOR.$packageName); |
62 | 62 | |
63 | 63 | return false !== $realPath ? $realPath : null; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | return array_map( |
93 | - function (array $package): string { |
|
93 | + function(array $package): string { |
|
94 | 94 | return $package['name']; |
95 | 95 | }, |
96 | 96 | $composerLockDecodedContents['packages-dev'] |
@@ -16,13 +16,13 @@ |
||
16 | 16 | |
17 | 17 | use ErrorException; |
18 | 18 | |
19 | -($GLOBALS['_BOX_BOOTSTRAP'] = function (): void { |
|
19 | +($GLOBALS['_BOX_BOOTSTRAP'] = function(): void { |
|
20 | 20 | \KevinGH\Box\register_aliases(); |
21 | 21 | })(); |
22 | 22 | |
23 | 23 | // Convert errors to exceptions |
24 | 24 | set_error_handler( |
25 | - function (int $code, string $message, string $file = '', int $line = -1): void { |
|
25 | + function(int $code, string $message, string $file = '', int $line = -1): void { |
|
26 | 26 | if (error_reporting() & $code) { |
27 | 27 | throw new ErrorException($message, 0, $code, (string) $file, $line); |
28 | 28 | } |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | 'Registering compactors' |
375 | 375 | ); |
376 | 376 | |
377 | - $logCompactors = function (Compactor $compactor) use ($logger): void { |
|
377 | + $logCompactors = function(Compactor $compactor) use ($logger): void { |
|
378 | 378 | $compactorClassParts = explode('\\', get_class($compactor)); |
379 | 379 | |
380 | 380 | if ('_HumbugBox' === substr($compactorClassParts[0], 0, strlen('_HumbugBox'))) { |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | */ |
614 | 614 | private function bumpOpenFileDescriptorLimit(Box $box, SymfonyStyle $io): callable |
615 | 615 | { |
616 | - $filesCount = count($box) + 128; // Add a little extra for good measure |
|
616 | + $filesCount = count($box) + 128; // Add a little extra for good measure |
|
617 | 617 | |
618 | 618 | if (function_exists('posix_getrlimit') && function_exists('posix_setrlimit')) { |
619 | 619 | $softLimit = posix_getrlimit()['soft openfiles']; |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | ); |
647 | 647 | } |
648 | 648 | |
649 | - return function () use ($io, $softLimit, $hardLimit): void { |
|
649 | + return function() use ($io, $softLimit, $hardLimit): void { |
|
650 | 650 | if (function_exists('posix_setrlimit') && isset($softLimit, $hardLimit)) { |
651 | 651 | posix_setrlimit( |
652 | 652 | POSIX_RLIMIT_NOFILE, |
@@ -128,6 +128,6 @@ |
||
128 | 128 | ); |
129 | 129 | |
130 | 130 | $this->assertFalse($requirement->isFulfilled()); |
131 | - $this->assertFalse($requirement->isFulfilled()); // Would have gave `true` if it was evaluated a second time |
|
131 | + $this->assertFalse($requirement->isFulfilled()); // Would have gave `true` if it was evaluated a second time |
|
132 | 132 | } |
133 | 133 | } |