Passed
Pull Request — master (#160)
by Théo
03:00
created
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
             },
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
         $mapFile = $this->mapFile;
315 315
         $placeholders = $this->placeholders;
316 316
         $compactors = $this->compactors;
317
-        $bootstrap = $GLOBALS['_BOX_BOOTSTRAP'] ?? function (): void {};
317
+        $bootstrap = $GLOBALS['_BOX_BOOTSTRAP'] ?? function(): void {};
318 318
 
319
-        $processFile = function (string $file) use ($cwd, $basePath, $mapFile, $placeholders, $compactors, $bootstrap): array {
319
+        $processFile = function(string $file) use ($cwd, $basePath, $mapFile, $placeholders, $compactors, $bootstrap): array {
320 320
             chdir($cwd);
321 321
             $bootstrap();
322 322
 
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
     {
366 366
         return array_reduce(
367 367
             $compactors,
368
-            function (string $contents, Compactor $compactor) use ($file): string {
368
+            function(string $contents, Compactor $compactor) use ($file): string {
369 369
                 return $compactor->compact($file, $contents);
370 370
             },
371 371
             $contents
Please login to merge, or discard this patch.
src/bootstrap.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.
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 use function unlink;
32 32
 use function var_dump;
33 33
 
34
-$findAutoloader = function () {
34
+$findAutoloader = function() {
35 35
 //    if (file_exists($autoload = __DIR__.'/../../../autoload.php')) {
36 36
 //        // Is installed via Composer
37 37
 //        return $autoload;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 };
58 58
 
59 59
 // TODO: update PHP-Scoper to get rid of this horrible hack at some point
60
-$findPhpScoperFunctions = function (): void {
60
+$findPhpScoperFunctions = function(): void {
61 61
     if (file_exists($autoload = __DIR__.'/../../php-scoper/src/functions.php')) {
62 62
         // Is installed via Composer
63 63
         require_once $autoload;
@@ -81,13 +81,13 @@  discard block
 block discarded – undo
81 81
         }
82 82
 
83 83
         $pharPath = dirname(substr(__FILE__, 7), 2);
84
-        define('PHAR_COPY', sys_get_temp_dir().'/phar-'.bin2hex(random_bytes(10)). '.phar');
84
+        define('PHAR_COPY', sys_get_temp_dir().'/phar-'.bin2hex(random_bytes(10)).'.phar');
85 85
 
86 86
         copy($pharPath, \PHAR_COPY);
87 87
 
88
-        $autoload = 'phar://'.\PHAR_COPY. '/vendor/humbug/php-scoper/src/functions.php';
88
+        $autoload = 'phar://'.\PHAR_COPY.'/vendor/humbug/php-scoper/src/functions.php';
89 89
 
90
-        register_shutdown_function(static function () {
90
+        register_shutdown_function(static function() {
91 91
             @unlink(\PHAR_COPY);
92 92
         });
93 93
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     throw new RuntimeException('Unable to find the PHP-Scoper functions.');
100 100
 };
101 101
 
102
-$bootstrap = function () use ($findAutoloader, $findPhpScoperFunctions): void {
102
+$bootstrap = function() use ($findAutoloader, $findPhpScoperFunctions): void {
103 103
 //    require_once $findAutoloader();
104 104
     $findPhpScoperFunctions();
105 105
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
 // Convert errors to exceptions
113 113
 set_error_handler(
114
-    function ($code, $message, $file, $line): void {
114
+    function($code, $message, $file, $line): void {
115 115
         if (error_reporting() & $code) {
116 116
             throw new ErrorException($message, 0, $code, $file, $line);
117 117
         }
Please login to merge, or discard this patch.