Passed
Push — main ( 09fd06...633b92 )
by Dimitri
03:33
created
src/Formatter/ArrayFormatter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
      */
26 26
     public function format($data)
27 27
     {
28
-        if (! is_array($data)) {
28
+        if (!is_array($data)) {
29 29
             $data = (array) $data;
30 30
         }
31 31
 
Please login to merge, or discard this patch.
src/Core/App.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
             }
70 70
         }
71 71
 
72
-        if ($plugin || ! static::_classExistsInBase($fullname, 'BlitzPHP')) {
72
+        if ($plugin || !static::_classExistsInBase($fullname, 'BlitzPHP')) {
73 73
             return null;
74 74
         }
75 75
 
Please login to merge, or discard this patch.
src/Core/Application.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@
 block discarded – undo
122 122
             ->requireDirectory(APP_PATH, Checker::CHECK_IS_READABLE);
123 123
 
124 124
         $output = $checker->check();
125
-        if (! $checker->isSatisfied()) {
125
+        if (!$checker->isSatisfied()) {
126 126
             echo '<h3>An error encourred</h3>';
127 127
 
128 128
             exit(implode('<br/> ', $checker->getErrors()));
Please login to merge, or discard this patch.
spec/Router/Router.spec.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 describe("Router", function() {
10 10
     beforeEach(function() {
11
-        $this->collection      = new RouteCollection();
11
+        $this->collection = new RouteCollection();
12 12
 
13 13
         $routes = [
14 14
             'users'                                           => 'Users::index',
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 
377 377
             expect(function() use ($router) {
378 378
                 $router->handle('admin/admins/edit/1');
379
-            })->toThrow(new RouterException( 'The namespace delimiter is a backslash (\), not a slash (/). Route handler: \App/Admin/Admins::edit_show/$1'));
379
+            })->toThrow(new RouterException('The namespace delimiter is a backslash (\), not a slash (/). Route handler: \App/Admin/Admins::edit_show/$1'));
380 380
         });
381 381
 
382 382
         it(': Route avec barre oblique en tête', function() {
@@ -398,11 +398,11 @@  discard block
 block discarded – undo
398 398
         });
399 399
 
400 400
         it(': Options de route', function() {
401
-            $this->collection->add('foo', static function () {}, [
401
+            $this->collection->add('foo', static function() {}, [
402 402
                 'as'  => 'login',
403 403
                 'foo' => 'baz',
404 404
             ]);
405
-            $this->collection->add('baz', static function () {}, [
405
+            $this->collection->add('baz', static function() {}, [
406 406
                 'as'  => 'admin',
407 407
                 'foo' => 'bar',
408 408
             ]);
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 
471 471
     describe('Groupes et middlewares', function() {
472 472
         it(': Le routeur fonctionne avec les middlewares', function() {
473
-            $this->collection->group('foo', ['filter' => 'test'], static function (RouteCollection $routes) {
473
+            $this->collection->group('foo', ['filter' => 'test'], static function(RouteCollection $routes) {
474 474
                 $routes->add('bar', 'TestController::foobar');
475 475
             });
476 476
             
Please login to merge, or discard this patch.
spec/bootstrap.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 $_SERVER['ENVIRONMENT'] = 'testing';
24 24
 define('ENVIRONMENT', 'testing');
25 25
 defined('DEBUG') || define('DEBUG', true);
26
-defined('DS')    || define('DS', DIRECTORY_SEPARATOR);
26
+defined('DS') || define('DS', DIRECTORY_SEPARATOR);
27 27
 
28 28
 // Often these constants are pre-defined, but query the current directory structure as a fallback
29 29
 defined('HOME_PATH') || define('HOME_PATH', realpath(rtrim(getcwd(), '\\/ ')) . DS);
@@ -35,15 +35,15 @@  discard block
 block discarded – undo
35 35
 defined('VENDOR_PATH') || define('VENDOR_PATH', realpath(HOME_PATH . 'vendor') . DS);
36 36
 
37 37
 // Define necessary framework path constants
38
-defined('SYST_PATH')    || define('SYST_PATH', realpath(HOME_PATH . 'src') . DS);
39
-defined('TEST_PATH')    || define('TEST_PATH', realpath(HOME_PATH . 'spec') . DS);
38
+defined('SYST_PATH') || define('SYST_PATH', realpath(HOME_PATH . 'src') . DS);
39
+defined('TEST_PATH') || define('TEST_PATH', realpath(HOME_PATH . 'spec') . DS);
40 40
 defined('SUPPORT_PATH') || define('SUPPORT_PATH', TEST_PATH . '_support' . DS);
41
-defined('APP_PATH')     || define('APP_PATH', SUPPORT_PATH . 'app' . DS);
41
+defined('APP_PATH') || define('APP_PATH', SUPPORT_PATH . 'app' . DS);
42 42
 defined('STORAGE_PATH') || define('STORAGE_PATH', SUPPORT_PATH . 'storage' . DS);
43
-defined('WEBROOT')      || define('WEBROOT', SUPPORT_PATH . 'public' . DS);
43
+defined('WEBROOT') || define('WEBROOT', SUPPORT_PATH . 'public' . DS);
44 44
 
45 45
 // Set environment values that would otherwise stop the framework from functioning during tests.
46
-if (! isset($_SERVER['app.baseURL'])) {
46
+if (!isset($_SERVER['app.baseURL'])) {
47 47
     $_SERVER['app.baseURL'] = 'http://example.com/';
48 48
 }
49 49
 define('BASE_URL', $_SERVER['app.baseURL']);
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 if (file_exists(APP_PATH . 'Config' . DS . 'routes.php')) {
73 73
     require_once APP_PATH . 'Config' . DS . 'routes.php';
74 74
 }
75
-if (empty($routes) || ! ($routes instanceof RouteCollectionInterface)) {
75
+if (empty($routes) || !($routes instanceof RouteCollectionInterface)) {
76 76
     $routes = new RouteCollection();
77 77
 }
78 78
 
Please login to merge, or discard this patch.
src/Config/Config.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     {
88 88
         if (is_array($config)) {
89 89
             foreach ($config as $key => $value) {
90
-                if (! is_string($value) || empty($value)) {
90
+                if (!is_string($value) || empty($value)) {
91 91
                     continue;
92 92
                 }
93 93
                 if (is_string($key)) {
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
                 }
100 100
                 self::load($conf, $file);
101 101
             }
102
-        } elseif (is_string($config) && ! isset(self::$loaded[$config])) {
102
+        } elseif (is_string($config) && !isset(self::$loaded[$config])) {
103 103
             if (empty($file)) {
104 104
                 $file = self::path($config);
105 105
             }
106 106
 
107 107
             $configurations = [];
108
-            if (file_exists($file) && ! in_array($file, get_included_files(), true)) {
108
+            if (file_exists($file) && !in_array($file, get_included_files(), true)) {
109 109
                 $configurations = (array) require $file;
110 110
             }
111 111
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     {
131 131
         if (is_array($accepts_values)) {
132 132
             $accepts_values = '(Accept values: ' . implode('/', $accepts_values) . ')';
133
-        } elseif (! is_string($accepts_values)) {
133
+        } elseif (!is_string($accepts_values)) {
134 134
             throw new InvalidArgumentException('Misuse of the method ' . __METHOD__);
135 135
         }
136 136
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
             $schema = require $app_schema;
177 177
         }
178 178
 
179
-        if (empty($schema) || ! ($schema instanceof Schema)) {
179
+        if (empty($schema) || !($schema instanceof Schema)) {
180 180
             $schema = Expect::mixed();
181 181
         }
182 182
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
      */
202 202
     private function initializeURL()
203 203
     {
204
-        if (! $this->configurator->exists('app.base_url')) {
204
+        if (!$this->configurator->exists('app.base_url')) {
205 205
             $config = 'auto';
206 206
         } else {
207 207
             $config = $this->configurator->get('app.base_url');
@@ -257,17 +257,17 @@  discard block
 block discarded – undo
257 257
      */
258 258
     private function initializeDebugbar()
259 259
     {
260
-        if (! $this->configurator->exists('app.show_debugbar')) {
260
+        if (!$this->configurator->exists('app.show_debugbar')) {
261 261
             $config = 'auto';
262 262
         } else {
263 263
             $config = $this->configurator->get('app.show_debugbar');
264 264
         }
265 265
 
266
-        if (! in_array($config, ['auto', true, false], true)) {
266
+        if (!in_array($config, ['auto', true, false], true)) {
267 267
             self::exceptBadConfigValue('show_debugbar', ['auto', true, false], 'app');
268 268
         }
269 269
         if ($config === 'auto') {
270
-            $this->configurator->set('app.show_debugbar', ! is_online());
270
+            $this->configurator->set('app.show_debugbar', !is_online());
271 271
         }
272 272
     }
273 273
 }
Please login to merge, or discard this patch.
src/Loader/Load.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,16 +35,16 @@  discard block
 block discarded – undo
35 35
 
36 36
         // services système
37 37
         $filename = SYST_PATH . 'Constants' . DS . 'providers.php';
38
-        if (! file_exists($filename)) {
38
+        if (!file_exists($filename)) {
39 39
             throw LoadException::providersDefinitionDontExist($filename);
40 40
         }
41
-        if (! in_array($filename, get_included_files(), true)) {
41
+        if (!in_array($filename, get_included_files(), true)) {
42 42
             $providers = array_merge($providers, require $filename);
43 43
         }
44 44
 
45 45
         // services de l'application
46 46
         $filename = CONFIG_PATH . 'providers.php';
47
-        if (file_exists($filename) && ! in_array($filename, get_included_files(), true)) {
47
+        if (file_exists($filename) && !in_array($filename, get_included_files(), true)) {
48 48
             $providers = array_merge($providers, require $filename);
49 49
         }
50 50
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     {
78 78
         $locale ??= config('app.language');
79 79
 
80
-        if (! self::isLoaded('langs', $file . $locale)) {
80
+        if (!self::isLoaded('langs', $file . $locale)) {
81 81
             self::loaded('langs', $file . $locale, FileLocator::lang($file, $locale));
82 82
         }
83 83
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     private static function isLoaded(string $module, $element): bool
93 93
     {
94
-        if (! isset(self::$loads[$module]) || ! is_array(self::$loads[$module])) {
94
+        if (!isset(self::$loads[$module]) || !is_array(self::$loads[$module])) {
95 95
             return false;
96 96
         }
97 97
 
Please login to merge, or discard this patch.
src/Loader/FileLocator.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
         foreach ($paths as $path) {
44 44
             if (file_exists($path)) {
45
-                if (! in_array($path, get_included_files(), true)) {
45
+                if (!in_array($path, get_included_files(), true)) {
46 46
                     $languages = array_merge($languages, (array) require($path));
47 47
                 }
48 48
                 $file_exist = true;
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
             throw LoadException::libraryNotFound($lib);
120 120
         }
121 121
 
122
-        if (true !== $file_syst && ! class_exists($lib)) {
122
+        if (true !== $file_syst && !class_exists($lib)) {
123 123
             throw LoadException::libraryDontExist($lib);
124 124
         }
125 125
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $model = explode('/', $model);
138 138
 
139 139
         $mod                      = ucfirst(end($model));
140
-        $mod                      = (! preg_match('#Model$#', $mod)) ? $mod . 'Model' : $mod;
140
+        $mod                      = (!preg_match('#Model$#', $mod)) ? $mod . 'Model' : $mod;
141 141
         $model[count($model) - 1] = $mod;
142 142
 
143 143
         foreach ($model as $key => &$value) {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
         $path = MODEL_PATH . Helpers::ensureExt(implode(DS, $model), 'php');
150 150
 
151
-        if (! file_exists($path)) {
151
+        if (!file_exists($path)) {
152 152
             throw LoadException::modelNotFound($mod, $path);
153 153
         }
154 154
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         if (class_exists($class_namespaced, false)) {
160 160
             return Injector::make($class_namespaced);
161 161
         }
162
-        if (! class_exists($mod, false)) {
162
+        if (!class_exists($mod, false)) {
163 163
             throw LoadException::modelDontExist($mod, $path);
164 164
         }
165 165
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         $controller = explode('/', $controller);
178 178
 
179 179
         $con                                = ucfirst(end($controller));
180
-        $con                                = (! preg_match('#Controller$#', $con)) ? $con . 'Controller' : $con;
180
+        $con                                = (!preg_match('#Controller$#', $con)) ? $con . 'Controller' : $con;
181 181
         $controller[count($controller) - 1] = $con;
182 182
 
183 183
         foreach ($controller as $key => &$value) {
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
         $path = CONTROLLER_PATH . Helpers::ensureExt(implode(DS, $controller), 'php');
190 190
 
191
-        if (! file_exists($path)) {
191
+        if (!file_exists($path)) {
192 192
             throw LoadException::controllerNotFound(str_replace('Controller', '', $con), $path);
193 193
         }
194 194
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         if (class_exists($class_namespaced, false)) {
200 200
             return Injector::make($class_namespaced);
201 201
         }
202
-        if (! class_exists($con, false)) {
202
+        if (!class_exists($con, false)) {
203 203
             throw LoadException::controllerDontExist(str_replace('Controller', '', $con), $path);
204 204
         }
205 205
 
Please login to merge, or discard this patch.
src/Loader/Filesystem.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
         foreach ($paths as $path) {
183 183
             try {
184
-                if (! @unlink($path)) {
184
+                if (!@unlink($path)) {
185 185
                     $success = false;
186 186
                 }
187 187
             } catch (ErrorException $e) {
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
      */
198 198
     public static function move(string $path, string $target, bool $overwrite = true): bool
199 199
     {
200
-        if (! is_file($target) || ($overwrite && is_file($target))) {
200
+        if (!is_file($target) || ($overwrite && is_file($target))) {
201 201
             return rename($path, $target);
202 202
         }
203 203
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
      */
210 210
     public static function copy(string $path, string $target, bool $overwrite = true): bool
211 211
     {
212
-        if (! is_file($target) || ($overwrite && is_file($target))) {
212
+        if (!is_file($target) || ($overwrite && is_file($target))) {
213 213
             return copy($path, $target);
214 214
         }
215 215
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
      */
224 224
     public static function link(string $target, string $link)
225 225
     {
226
-        if (! is_windows()) {
226
+        if (!is_windows()) {
227 227
             return symlink($target, $link);
228 228
         }
229 229
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
      */
346 346
     public static function files(string $directory, bool $hidden = false, string $sortBy = 'name'): array
347 347
     {
348
-        $files = Finder::create()->files()->ignoreDotFiles(! $hidden)->in($directory)->depth(0);
348
+        $files = Finder::create()->files()->ignoreDotFiles(!$hidden)->in($directory)->depth(0);
349 349
 
350 350
         switch (strtolower($sortBy)) {
351 351
             case 'type':
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
      */
383 383
     public static function allFiles(string $directory, bool $hidden = false, string $sortBy = 'name'): array
384 384
     {
385
-        $files = Finder::create()->files()->ignoreDotFiles(! $hidden)->in($directory);
385
+        $files = Finder::create()->files()->ignoreDotFiles(!$hidden)->in($directory);
386 386
 
387 387
         switch (strtolower($sortBy)) {
388 388
             case 'type':
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
     {
420 420
         $directories = [];
421 421
 
422
-        foreach (Finder::create()->ignoreDotFiles(! $hidden)->in($directory)->directories()->depth($depth)->sortByName() as $dir) {
422
+        foreach (Finder::create()->ignoreDotFiles(!$hidden)->in($directory)->directories()->depth($depth)->sortByName() as $dir) {
423 423
             $directories[] = $dir->getPathname();
424 424
         }
425 425
 
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
      */
444 444
     public static function moveDirectory(string $from, string $to, bool $overwrite = false): bool
445 445
     {
446
-        if ($overwrite && self::isDirectory($to) && ! self::deleteDirectory($to)) {
446
+        if ($overwrite && self::isDirectory($to) && !self::deleteDirectory($to)) {
447 447
             return false;
448 448
         }
449 449
 
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
      */
456 456
     public static function copyDirectory(string $directory, string $destination, bool $overwrite = true, ?int $options = null): bool
457 457
     {
458
-        if (! self::isDirectory($directory)) {
458
+        if (!self::isDirectory($directory)) {
459 459
             return false;
460 460
         }
461 461
 
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
         // If the destination directory does not actually exist, we will go ahead and
465 465
         // create it recursively, which just gets the destination prepared to copy
466 466
         // the files over. Once we make the directory we'll proceed the copying.
467
-        if (! self::isDirectory($destination)) {
467
+        if (!self::isDirectory($destination)) {
468 468
             self::makeDirectory($destination, 0777, true);
469 469
         }
470 470
 
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
             if ($item->isDir()) {
480 480
                 $path = $item->getPathname();
481 481
 
482
-                if (! self::copyDirectory($path, $target, $overwrite, $options)) {
482
+                if (!self::copyDirectory($path, $target, $overwrite, $options)) {
483 483
                     return false;
484 484
                 }
485 485
             }
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
             // location and keep looping. If for some reason the copy fails we'll bail out
489 489
             // and return false, so the developer is aware that the copy process failed.
490 490
             else {
491
-                if (! self::copy($item->getPathname(), $target, $overwrite)) {
491
+                if (!self::copy($item->getPathname(), $target, $overwrite)) {
492 492
                     return false;
493 493
                 }
494 494
             }
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
      */
505 505
     public static function deleteDirectory(string $directory, bool $preserve = false): bool
506 506
     {
507
-        if (! self::isDirectory($directory)) {
507
+        if (!self::isDirectory($directory)) {
508 508
             return false;
509 509
         }
510 510
 
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
             // If the item is a directory, we can just recurse into the function and
515 515
             // delete that sub-directory otherwise we'll just delete the file and
516 516
             // keep iterating through each file until the directory is cleaned.
517
-            if ($item->isDir() && ! $item->isLink()) {
517
+            if ($item->isDir() && !$item->isLink()) {
518 518
                 self::deleteDirectory($item->getPathname());
519 519
             }
520 520
 
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
             }
527 527
         }
528 528
 
529
-        if (! $preserve) {
529
+        if (!$preserve) {
530 530
             @rmdir($directory);
531 531
         }
532 532
 
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
     {
541 541
         $allDirectories = self::directories($directory);
542 542
 
543
-        if (! empty($allDirectories)) {
543
+        if (!empty($allDirectories)) {
544 544
             foreach ($allDirectories as $directoryName) {
545 545
                 self::deleteDirectory($directoryName);
546 546
             }
Please login to merge, or discard this patch.