Completed
Pull Request — master (#100)
by Christophe
03:40
created
src/Composer/ComposerOrchestrator.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/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.
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         return array_filter(
85 85
             array_map(
86
-                function (string $packageName) use ($vendorDir): ?string {
86
+                function(string $packageName) use ($vendorDir): ?string {
87 87
                     $realPath = realpath($vendorDir.DIRECTORY_SEPARATOR.$packageName);
88 88
 
89 89
                     return false !== $realPath ? $realPath : null;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         }
148 148
 
149 149
         return array_map(
150
-            function (array $package): string {
150
+            function(array $package): string {
151 151
                 return $package['name'];
152 152
             },
153 153
             $config['packages-dev']
Please login to merge, or discard this patch.
src/Json/Json.php 1 patch
Spacing   +2 added lines, -2 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.
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
             }
54 54
         }
55 55
 
56
-        return false === $assoc ? (object) $data : $data;   // If JSON is an empty JSON json_decode returns an empty
56
+        return false === $assoc ? (object) $data : $data; // If JSON is an empty JSON json_decode returns an empty
57 57
                                                             // array instead of an stdClass instance
58 58
     }
59 59
 
Please login to merge, or discard this patch.
src/Console/Command/Compile.php 1 patch
Spacing   +2 added lines, -2 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.
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
             'Registering compactors'
224 224
         );
225 225
 
226
-        $logCompactors = function (Compactor $compactor) use ($logger): void {
226
+        $logCompactors = function(Compactor $compactor) use ($logger): void {
227 227
             $logger->log(
228 228
                 BuildLogger::PLUS_PREFIX,
229 229
                 get_class($compactor)
Please login to merge, or discard this patch.
src/Console/Command/Build.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.
scoper.inc.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.
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 return [
16 16
     'patchers' => [
17
-        function (string $filePath, string $prefix, string $contents): string {
17
+        function(string $filePath, string $prefix, string $contents): string {
18 18
             $file = 'vendor/beberlei/assert/lib/Assert/Assertion.php';
19 19
 
20 20
             if ($filePath !== $file) {
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
                 $contents
31 31
             );
32 32
         },
33
-        function (string $filePath, string $prefix, string $contents): string {
33
+        function(string $filePath, string $prefix, string $contents): string {
34 34
             $files = [
35 35
                 'src/functions.php',
36 36
                 'src/Configuration.php',
Please login to merge, or discard this patch.
src/Configuration.php 1 patch
Spacing   +13 added lines, -13 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.
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
     {
484 484
         $blacklist = self::retrieveBlacklist($raw, $basePath);
485 485
 
486
-        return function (SplFileInfo $file) use ($blacklist): ?bool {
486
+        return function(SplFileInfo $file) use ($blacklist): ?bool {
487 487
             if (in_array($file->getRealPath(), $blacklist, true)) {
488 488
                 return false;
489 489
             }
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 
507 507
         $blacklist = $raw->blacklist;
508 508
 
509
-        $normalizePath = function ($file) use ($basePath): string {
509
+        $normalizePath = function($file) use ($basePath): string {
510 510
             return self::normalizePath($file, $basePath);
511 511
         };
512 512
 
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 
531 531
         Assertion::allString($files);
532 532
 
533
-        $normalizePath = function (string $file) use ($basePath, $key): SplFileInfo {
533
+        $normalizePath = function(string $file) use ($basePath, $key): SplFileInfo {
534 534
             $file = self::normalizePath($file, $basePath);
535 535
 
536 536
             if (is_link($file)) {
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
         Closure $blacklistFilter,
622 622
         array $devPackages
623 623
     ): array {
624
-        $processFinderConfig = function (stdClass $config) use ($basePath, $blacklistFilter, $devPackages) {
624
+        $processFinderConfig = function(stdClass $config) use ($basePath, $blacklistFilter, $devPackages) {
625 625
             return self::processFinder($config, $basePath, $blacklistFilter, $devPackages);
626 626
         };
627 627
 
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
             ->files()
643 643
             ->filter($blacklistFilter)
644 644
             ->filter(
645
-                function (SplFileInfo $fileInfo) use ($devPackages): bool {
645
+                function(SplFileInfo $fileInfo) use ($devPackages): bool {
646 646
                     foreach ($devPackages as $devPackage) {
647 647
                         if ($devPackage === longest_common_base_path([$devPackage, $fileInfo->getRealPath()])) {
648 648
                             // File belongs to the dev package
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
             ->ignoreVCS(true)
657 657
         ;
658 658
 
659
-        $normalizedConfig = (function (array $config, Finder $finder): array {
659
+        $normalizedConfig = (function(array $config, Finder $finder): array {
660 660
             $normalizedConfig = [];
661 661
 
662 662
             foreach ($config as $method => $arguments) {
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
             return $normalizedConfig;
678 678
         })((array) $config, $finder);
679 679
 
680
-        $createNormalizedDirectories = function (string $directory) use ($basePath): ?string {
680
+        $createNormalizedDirectories = function(string $directory) use ($basePath): ?string {
681 681
             $directory = self::normalizePath($directory, $basePath);
682 682
 
683 683
             if (is_link($directory)) {
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
             return $directory;
696 696
         };
697 697
 
698
-        $normalizeFileOrDirectory = function (string &$fileOrDirectory) use ($basePath): void {
698
+        $normalizeFileOrDirectory = function(string &$fileOrDirectory) use ($basePath): void {
699 699
             $fileOrDirectory = self::normalizePath($fileOrDirectory, $basePath);
700 700
 
701 701
             if (is_link($fileOrDirectory)) {
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
         array $devPackages
765 765
     ): array {
766 766
         $relativeDevPackages = array_map(
767
-            function (string $packagePath) use ($basePath): string {
767
+            function(string $packagePath) use ($basePath): string {
768 768
                 return make_path_relative($packagePath, $basePath);
769 769
             },
770 770
             $devPackages
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
         return array_filter(
783 783
             array_unique(
784 784
                 array_map(
785
-                    function (SplFileInfo $fileInfo): ?string {
785
+                    function(SplFileInfo $fileInfo): ?string {
786 786
                         if (is_link((string) $fileInfo)) {
787 787
                             return null;
788 788
                         }
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
 
813 813
         $directories = $raw->{$key};
814 814
 
815
-        $normalizeDirectory = function (string $directory) use ($basePath, $key): string {
815
+        $normalizeDirectory = function(string $directory) use ($basePath, $key): string {
816 816
             $directory = self::normalizePath($directory, $basePath);
817 817
 
818 818
             if (is_link($directory)) {
@@ -872,7 +872,7 @@  discard block
 block discarded – undo
872 872
         $compactorClasses = array_unique((array) $raw->compactors);
873 873
 
874 874
         return array_map(
875
-            function (string $class) use ($raw, $basePath): Compactor {
875
+            function(string $class) use ($raw, $basePath): Compactor {
876 876
                 Assertion::classExists($class, 'The compactor class "%s" does not exist.');
877 877
                 Assertion::implementsInterface($class, Compactor::class, 'The class "%s" is not a compactor class.');
878 878
 
Please login to merge, or discard this patch.
src/Box.php 1 patch
Spacing   +8 added lines, -8 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.
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $this->file = $file;
86 86
 
87 87
         $this->basePath = getcwd();
88
-        $this->mapFile = function (): void { };
88
+        $this->mapFile = function(): void { };
89 89
     }
90 90
 
91 91
     /**
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
         $filesWithContents = $this->processContents(
184 184
             array_map(
185
-                function ($file): string {
185
+                function($file): string {
186 186
                     // Convert files to string as SplFileInfo is not serializable
187 187
                     return (string) $file;
188 188
                 },
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
                 $processedContents = $contents;
261 261
             }
262 262
 
263
-            remove(self::DEBUG_DIR);    // Cleanup previous temporary debug directory
263
+            remove(self::DEBUG_DIR); // Cleanup previous temporary debug directory
264 264
             dump_file(self::DEBUG_DIR.DIRECTORY_SEPARATOR.$relativePath, $processedContents);
265 265
         }
266 266
 
@@ -331,9 +331,9 @@  discard block
 block discarded – undo
331 331
         $mapFile = $this->mapFile;
332 332
         $placeholders = $this->placeholders;
333 333
         $compactors = $this->compactors;
334
-        $bootstrap = $GLOBALS['bootstrap'] ?? function (): void {};
334
+        $bootstrap = $GLOBALS['bootstrap'] ?? function(): void {};
335 335
 
336
-        $processFile = function (string $file) use ($cwd, $basePath, $mapFile, $placeholders, $compactors, $bootstrap): array {
336
+        $processFile = function(string $file) use ($cwd, $basePath, $mapFile, $placeholders, $compactors, $bootstrap): array {
337 337
             chdir($cwd);
338 338
             $bootstrap();
339 339
 
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
     {
383 383
         return array_reduce(
384 384
             $compactors,
385
-            function (string $contents, Compactor $compactor) use ($file): string {
385
+            function(string $contents, Compactor $compactor) use ($file): string {
386 386
                 return $compactor->compact($file, $contents);
387 387
             },
388 388
             $contents
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
         $mainScript = current(
399 399
             array_filter(
400 400
                 scandir($debugDir, 1),
401
-                function (string $file): bool {
401
+                function(string $file): bool {
402 402
                     return false === in_array($file, ['.', '..'], true);
403 403
                 }
404 404
             )
Please login to merge, or discard this patch.
src/Console/Command/Info.php 1 patch
Spacing   +2 added lines, -2 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.
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
             0
352 352
         );
353 353
 
354
-        $countFile = function (array $count, PharFileInfo $file) {
354
+        $countFile = function(array $count, PharFileInfo $file) {
355 355
             if (false === $file->isCompressed()) {
356 356
                 ++$count['None'];
357 357
 
Please login to merge, or discard this patch.