Passed
Push — master ( c4a949...d36bfc )
by Théo
02:26
created
src/PhpScoper/NullScoper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 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.
Please login to merge, or discard this patch.
src/PhpScoper/SimpleScoper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 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.
Please login to merge, or discard this patch.
src/Configuration.php 1 patch
Spacing   +14 added lines, -14 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.
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
     {
529 529
         $blacklist = self::retrieveBlacklist($raw, $basePath, ...$excludedPaths);
530 530
 
531
-        $blacklistFilter = function (SplFileInfo $file) use ($blacklist): ?bool {
531
+        $blacklistFilter = function(SplFileInfo $file) use ($blacklist): ?bool {
532 532
             if ($file->isLink()) {
533 533
                 return false;
534 534
             }
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 
593 593
         Assertion::allString($files);
594 594
 
595
-        $normalizePath = function (string $file) use ($basePath, $key): SplFileInfo {
595
+        $normalizePath = function(string $file) use ($basePath, $key): SplFileInfo {
596 596
             $file = self::normalizePath($file, $basePath);
597 597
 
598 598
             if (is_link($file)) {
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
         Closure $blacklistFilter,
693 693
         array $devPackages
694 694
     ): array {
695
-        $processFinderConfig = function (stdClass $config) use ($basePath, $blacklistFilter, $devPackages) {
695
+        $processFinderConfig = function(stdClass $config) use ($basePath, $blacklistFilter, $devPackages) {
696 696
             return self::processFinder($config, $basePath, $blacklistFilter, $devPackages);
697 697
         };
698 698
 
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
             ->files()
718 718
             ->filter($blacklistFilter)
719 719
             ->filter(
720
-                function (SplFileInfo $fileInfo) use ($devPackages): bool {
720
+                function(SplFileInfo $fileInfo) use ($devPackages): bool {
721 721
                     foreach ($devPackages as $devPackage) {
722 722
                         if ($devPackage === longest_common_base_path([$devPackage, $fileInfo->getRealPath()])) {
723 723
                             // File belongs to the dev package
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
             ->ignoreVCS(true)
732 732
         ;
733 733
 
734
-        $normalizedConfig = (function (array $config, Finder $finder): array {
734
+        $normalizedConfig = (function(array $config, Finder $finder): array {
735 735
             $normalizedConfig = [];
736 736
 
737 737
             foreach ($config as $method => $arguments) {
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
             return $normalizedConfig;
753 753
         })((array) $config, $finder);
754 754
 
755
-        $createNormalizedDirectories = function (string $directory) use ($basePath): ?string {
755
+        $createNormalizedDirectories = function(string $directory) use ($basePath): ?string {
756 756
             $directory = self::normalizePath($directory, $basePath);
757 757
 
758 758
             if (is_link($directory)) {
@@ -770,7 +770,7 @@  discard block
 block discarded – undo
770 770
             return $directory;
771 771
         };
772 772
 
773
-        $normalizeFileOrDirectory = function (string &$fileOrDirectory) use ($basePath): void {
773
+        $normalizeFileOrDirectory = function(string &$fileOrDirectory) use ($basePath): void {
774 774
             $fileOrDirectory = self::normalizePath($fileOrDirectory, $basePath);
775 775
 
776 776
             if (is_link($fileOrDirectory)) {
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
         array $devPackages
842 842
     ): array {
843 843
         $relativeDevPackages = array_map(
844
-            function (string $packagePath) use ($basePath): string {
844
+            function(string $packagePath) use ($basePath): string {
845 845
                 return make_path_relative($packagePath, $basePath);
846 846
             },
847 847
             $devPackages
@@ -859,12 +859,12 @@  discard block
 block discarded – undo
859 859
         $excludedPaths = array_unique(
860 860
             array_filter(
861 861
                 array_map(
862
-                    function (string $path) use ($basePath): string {
862
+                    function(string $path) use ($basePath): string {
863 863
                         return make_path_relative($path, $basePath);
864 864
                     },
865 865
                     $excludedPaths
866 866
                 ),
867
-                function (string $path): bool {
867
+                function(string $path): bool {
868 868
                     return '..' !== substr($path, 0, 2);
869 869
                 }
870 870
             )
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
 
900 900
         $directories = $raw->{$key};
901 901
 
902
-        $normalizeDirectory = function (string $directory) use ($basePath, $key): string {
902
+        $normalizeDirectory = function(string $directory) use ($basePath, $key): string {
903 903
             $directory = self::normalizePath($directory, $basePath);
904 904
 
905 905
             if (is_link($directory)) {
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
         $compactorClasses = array_unique((array) $raw->compactors);
944 944
 
945 945
         return array_map(
946
-            function (string $class) use ($raw, $basePath): Compactor {
946
+            function(string $class) use ($raw, $basePath): Compactor {
947 947
                 Assertion::classExists($class, 'The compactor class "%s" does not exist.');
948 948
                 Assertion::implementsInterface($class, Compactor::class, 'The class "%s" is not a compactor class.');
949 949
 
@@ -1024,7 +1024,7 @@  discard block
 block discarded – undo
1024 1024
 
1025 1025
     private static function retrieveComposerFiles(string $basePath): array
1026 1026
     {
1027
-        $retrieveFileAndContents = function (string $file): array {
1027
+        $retrieveFileAndContents = function(string $file): array {
1028 1028
             $json = new Json();
1029 1029
 
1030 1030
             if (false === file_exists($file) || false === is_file($file) || false === is_readable($file)) {
Please login to merge, or discard this patch.
src/Box.php 1 patch
Spacing   +6 added lines, -6 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.
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $this->file = $file;
85 85
 
86 86
         $this->basePath = getcwd();
87
-        $this->mapFile = function (): void { };
87
+        $this->mapFile = function(): void { };
88 88
         $this->scoper = new NullScoper();
89 89
     }
90 90
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     public function addFiles(array $files, bool $binary, bool $dumpAutoload = false): void
171 171
     {
172 172
         $files = array_map(
173
-            function ($file): string {
173
+            function($file): string {
174 174
                 // Convert files to string as SplFileInfo is not serializable
175 175
                 return (string) $file;
176 176
             },
@@ -326,9 +326,9 @@  discard block
 block discarded – undo
326 326
         $mapFile = $this->mapFile;
327 327
         $placeholders = $this->placeholders;
328 328
         $compactors = $this->compactors;
329
-        $bootstrap = $GLOBALS['bootstrap'] ?? function (): void {};
329
+        $bootstrap = $GLOBALS['bootstrap'] ?? function(): void {};
330 330
 
331
-        $processFile = function (string $file) use ($cwd, $basePath, $mapFile, $placeholders, $compactors, $bootstrap): array {
331
+        $processFile = function(string $file) use ($cwd, $basePath, $mapFile, $placeholders, $compactors, $bootstrap): array {
332 332
             chdir($cwd);
333 333
             $bootstrap();
334 334
 
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
     {
378 378
         return array_reduce(
379 379
             $compactors,
380
-            function (string $contents, Compactor $compactor) use ($file): string {
380
+            function(string $contents, Compactor $compactor) use ($file): string {
381 381
                 return $compactor->compact($file, $contents);
382 382
             },
383 383
             $contents
Please login to merge, or discard this patch.
src/Composer/ComposerConfiguration.php 1 patch
Spacing   +3 added lines, -3 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.
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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']
Please login to merge, or discard this patch.
src/bootstrap.php 1 patch
Spacing   +5 added lines, -5 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.
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 use ErrorException;
18 18
 use RuntimeException;
19 19
 
20
-$findAutoloader = function () {
20
+$findAutoloader = function() {
21 21
     if (file_exists($autoload = __DIR__.'/../../../autoload.php')) {
22 22
         // Is installed via Composer
23 23
         return $autoload;
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 };
33 33
 
34 34
 // TODO: update PHP-Scoper to get rid of this horrible hack at some point
35
-$findPhpScoperFunctions = function () {
35
+$findPhpScoperFunctions = function() {
36 36
     if (file_exists($autoload = __DIR__.'/../../php-scoper/src/functions.php')) {
37 37
         // Is installed via Composer
38 38
         return $autoload;
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     throw new RuntimeException('Unable to find the PHP-Scoper functions.');
47 47
 };
48 48
 
49
-$bootstrap = function () use ($findAutoloader, $findPhpScoperFunctions): void {
49
+$bootstrap = function() use ($findAutoloader, $findPhpScoperFunctions): void {
50 50
     require_once $findAutoloader();
51 51
     require_once $findPhpScoperFunctions();
52 52
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
 // Convert errors to exceptions
60 60
 set_error_handler(
61
-    function ($code, $message, $file, $line): void {
61
+    function($code, $message, $file, $line): void {
62 62
         if (error_reporting() & $code) {
63 63
             throw new ErrorException($message, 0, $code, $file, $line);
64 64
         }
Please login to merge, or discard this patch.
scoper.inc.php 1 patch
Spacing   +6 added lines, -6 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.
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,7 +81,7 @@  discard block
 block discarded – undo
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 87
     ],
Please login to merge, or discard this patch.