Passed
Push — main ( 4cd58e...3399b6 )
by Dimitri
03:02
created
src/View/Adapters/NativeAdapter.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         // Enregistrer les variables actuelles
131 131
         $renderVars = $this->renderVars;
132 132
 
133
-        $output = (function (): string {
133
+        $output = (function(): string {
134 134
             extract($this->tempData);
135 135
             ob_start();
136 136
             include $this->renderVars['file'];
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
         $this->logPerformance($this->renderVars['start'], microtime(true), $this->renderVars['view']);
158 158
 
159
-        if (($this->debug && (! isset($options['debug']) || $options['debug'] === true))) {
159
+        if (($this->debug && (!isset($options['debug']) || $options['debug'] === true))) {
160 160
             // Nettoyer nos noms de chemins pour les rendre un peu plus propres
161 161
             $this->renderVars['file'] = clean_path($this->renderVars['file']);
162 162
             $this->renderVars['file'] = ++$this->viewsCount . ' ' . $this->renderVars['file'];
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         $saveData ??= $this->saveData;
186 186
         $this->prepareTemplateData($saveData);
187 187
 
188
-        $output = (function (string $view): string {
188
+        $output = (function(string $view): string {
189 189
             extract($this->tempData);
190 190
             ob_start();
191 191
             eval('?>' . $view);
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
         $section = array_pop($this->sectionStack);
314 314
 
315 315
         // Assurez-vous qu'un tableau existe afin que nous puissions stocker plusieurs entrées pour cela.
316
-        if (! array_key_exists($section, $this->sections)) {
316
+        if (!array_key_exists($section, $this->sections)) {
317 317
             $this->sections[$section] = [];
318 318
         }
319 319
 
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
      */
350 350
     public function show(string $sectionName)
351 351
     {
352
-        if (! isset($this->sections[$sectionName])) {
352
+        if (!isset($this->sections[$sectionName])) {
353 353
             echo '';
354 354
 
355 355
             return;
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
      *
419 419
      * @param mixed $saveData
420 420
      */
421
-    public function include(string $view, ?array $data = [], ?array $options = null, $saveData = true): string
421
+    public function include(string $view, ?array $data = [], ?array $options = null, $saveData = true) : string
422 422
     {
423 423
         return $this->insert($view, $data, $options, $saveData);
424 424
     }
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
     public function addLibCss(string ...$src): self
430 430
     {
431 431
         foreach ($src as $var) {
432
-            if (! in_array($var, $this->_lib_styles, true)) {
432
+            if (!in_array($var, $this->_lib_styles, true)) {
433 433
                 $this->_lib_styles[] = $var;
434 434
             }
435 435
         }
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
     public function addCss(string ...$src): self
444 444
     {
445 445
         foreach ($src as $var) {
446
-            if (! in_array($var, $this->_styles, true)) {
446
+            if (!in_array($var, $this->_styles, true)) {
447 447
                 $this->_styles[] = $var;
448 448
             }
449 449
         }
@@ -472,10 +472,10 @@  discard block
 block discarded – undo
472 472
             );
473 473
         }
474 474
 
475
-        if (! empty($lib_styles)) {
475
+        if (!empty($lib_styles)) {
476 476
             lib_styles(array_unique($lib_styles));
477 477
         }
478
-        if (! empty($styles)) {
478
+        if (!empty($styles)) {
479 479
             styles(array_unique($styles));
480 480
         }
481 481
 
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
     public function addLibJs(string ...$src): self
489 489
     {
490 490
         foreach ($src as $var) {
491
-            if (! in_array($var, $this->_lib_scripts, true)) {
491
+            if (!in_array($var, $this->_lib_scripts, true)) {
492 492
                 $this->_lib_scripts[] = $var;
493 493
             }
494 494
         }
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
     public function addJs(string ...$src): self
503 503
     {
504 504
         foreach ($src as $var) {
505
-            if (! in_array($var, $this->_scripts, true)) {
505
+            if (!in_array($var, $this->_scripts, true)) {
506 506
                 $this->_scripts[] = $var;
507 507
             }
508 508
         }
@@ -531,10 +531,10 @@  discard block
 block discarded – undo
531 531
             );
532 532
         }
533 533
 
534
-        if (! empty($lib_scripts)) {
534
+        if (!empty($lib_scripts)) {
535 535
             lib_scripts(array_unique($lib_scripts));
536 536
         }
537
-        if (! empty($scripts)) {
537
+        if (!empty($scripts)) {
538 538
             scripts(array_unique($scripts));
539 539
         }
540 540
 
Please login to merge, or discard this patch.
src/View/Adapters/SmartyAdapter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $this->renderVars['file'] = $this->getRenderedFile($options, $this->renderVars['view'], 'tpl');
62 62
 
63 63
         $layout = $this->layout;
64
-        if (! empty($layout)) {
64
+        if (!empty($layout)) {
65 65
             if (empty(pathinfo($layout, PATHINFO_EXTENSION))) {
66 66
                 $layout .= '.tpl';
67 67
             }
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $this->engine->assign($this->data);
72 72
 
73 73
         // Doit-on mettre en cache?
74
-        if (! empty($this->renderVars['options']['cache_name']) || ! empty($this->renderVars['options']['cache'])) {
74
+        if (!empty($this->renderVars['options']['cache_name']) || !empty($this->renderVars['options']['cache'])) {
75 75
             $this->enableCache();
76 76
             $this->engine->setCacheLifetime(60 * $this->renderVars['options']['cache'] ?? 60);
77 77
             $this->engine->setCompileId($this->renderVars['options']['cache_name'] ?? null);
Please login to merge, or discard this patch.
src/Cli/Console/Command.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
      */
307 307
     final protected function success(string $message, bool $badge = true, string $label = 'SUCCESS'): self
308 308
     {
309
-        if (! $badge) {
309
+        if (!$badge) {
310 310
             $this->writer->okBold($label);
311 311
         } else {
312 312
             $this->writer->boldWhiteBgGreen(" {$label} ");
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
      */
321 321
     final protected function warning(string $message, bool $badge = true, string $label = 'WARNING'): self
322 322
     {
323
-        if (! $badge) {
323
+        if (!$badge) {
324 324
             $this->writer->warnBold($label);
325 325
         } else {
326 326
             $this->writer->boldWhiteBgYellow(" {$label} ");
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
      */
335 335
     final protected function info(string $message, bool $badge = true, string $label = 'INFO'): self
336 336
     {
337
-        if (! $badge) {
337
+        if (!$badge) {
338 338
             $this->writer->infoBold($label);
339 339
         } else {
340 340
             $this->writer->boldWhiteBgCyan(" {$label} ");
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
      */
349 349
     final protected function error(string $message, bool $badge = true, string $label = 'ERROR'): self
350 350
     {
351
-        if (! $badge) {
351
+        if (!$badge) {
352 352
             $this->writer->errorBold($label);
353 353
         } else {
354 354
             $this->writer->boldWhiteBgRed(" {$label} ");
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
      */
454 454
     final protected function json($data): self
455 455
     {
456
-        $this->write(json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES), true);
456
+        $this->write(json_encode($data, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES), true);
457 457
 
458 458
         return $this;
459 459
     }
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
@@ -39,16 +39,16 @@  discard block
 block discarded – undo
39 39
 
40 40
         // services système
41 41
         $filename = SYST_PATH . 'Constants' . DS . 'providers.php';
42
-        if (! file_exists($filename)) {
42
+        if (!file_exists($filename)) {
43 43
             throw LoadException::providersDefinitionDontExist($filename);
44 44
         }
45
-        if (! in_array($filename, get_included_files(), true)) {
45
+        if (!in_array($filename, get_included_files(), true)) {
46 46
             $providers = array_merge($providers, require $filename);
47 47
         }
48 48
 
49 49
         // services de l'application
50 50
         $filename = CONFIG_PATH . 'providers.php';
51
-        if (file_exists($filename) && ! in_array($filename, get_included_files(), true)) {
51
+        if (file_exists($filename) && !in_array($filename, get_included_files(), true)) {
52 52
             $providers = array_merge($providers, require $filename);
53 53
         }
54 54
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             return $models;
98 98
         }
99 99
 
100
-        if (! self::isLoaded('models', $model)) {
100
+        if (!self::isLoaded('models', $model)) {
101 101
             self::loaded('models', $model, FileLocator::model($model, $connection));
102 102
         }
103 103
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      */
112 112
     private static function isLoaded(string $module, $element): bool
113 113
     {
114
-        if (! isset(self::$loads[$module]) || ! is_array(self::$loads[$module])) {
114
+        if (!isset(self::$loads[$module]) || !is_array(self::$loads[$module])) {
115 115
             return false;
116 116
         }
117 117
 
Please login to merge, or discard this patch.
src/Loader/Services.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -477,7 +477,7 @@
 block discarded – undo
477 477
         $name      = array_shift($arguments);
478 478
 
479 479
         if (empty(static::$instances[$name])) {
480
-            if (! empty($arguments)) {
480
+            if (!empty($arguments)) {
481 481
                 static::$instances[$name] = static::factory($name, $arguments);
482 482
             } else {
483 483
                 static::$instances[$name] = static::injector()->get($name);
Please login to merge, or discard this patch.
src/Http/Middleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
      */
66 66
     public function add($middlewares, array $options = []): self
67 67
     {
68
-        if (! is_array($middlewares)) {
68
+        if (!is_array($middlewares)) {
69 69
             $middlewares = [$middlewares];
70 70
         }
71 71
 
Please login to merge, or discard this patch.
src/Config/Database.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
             $group = on_test() ? 'test' : (on_prod() ? 'production' : 'development');
58 58
         }
59 59
 
60
-        if (! isset($config[$group]) && strpos($group, 'custom-') === false) {
60
+        if (!isset($config[$group]) && strpos($group, 'custom-') === false) {
61 61
             $group = 'default';
62 62
         }
63 63
 
64
-        if (is_string($group) && ! isset($config[$group]) && strpos($group, 'custom-') !== 0) {
64
+        if (is_string($group) && !isset($config[$group]) && strpos($group, 'custom-') !== 0) {
65 65
             throw new InvalidArgumentException($group . ' is not a valid database connection group.');
66 66
         }
67 67
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         $config = $config[$group];
73 73
 
74
-        if (str_contains($config['driver'], 'sqlite') && $config['database'] !== ':memory:' && ! str_contains($config['database'], DS)) {
74
+        if (str_contains($config['driver'], 'sqlite') && $config['database'] !== ':memory:' && !str_contains($config['database'], DS)) {
75 75
             $config['database'] = APP_STORAGE_PATH . $config['database'];
76 76
         }
77 77
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
         // Si le package "blitz-php/database" n'existe pas on renvoi une fake connection
95 95
         // Ceci est utile juste pour eviter le bug avec le service provider
96
-        if (! class_exists(Db::class)) {
96
+        if (!class_exists(Db::class)) {
97 97
             return static::createMockConnection();
98 98
         }
99 99
 
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
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
             throw LoadException::libraryNotFound($lib);
81 81
         }
82 82
 
83
-        if (true !== $file_syst && ! class_exists($lib)) {
83
+        if (true !== $file_syst && !class_exists($lib)) {
84 84
             throw LoadException::libraryDontExist($lib);
85 85
         }
86 86
 
@@ -98,16 +98,16 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public static function model(string $model, ?ConnectionInterface $connection = null)
100 100
     {
101
-        if (! class_exists($model) && ! Text::endsWith($model, 'Model')) {
101
+        if (!class_exists($model) && !Text::endsWith($model, 'Model')) {
102 102
             $model .= 'Model';
103 103
         }
104 104
 
105
-        if (! class_exists($model)) {
105
+        if (!class_exists($model)) {
106 106
             $model = str_replace(APP_NAMESPACE . '\\Models\\', '', $model);
107 107
             $model = APP_NAMESPACE . '\\Models\\' . $model;
108 108
         }
109 109
 
110
-        if (! class_exists($model)) {
110
+        if (!class_exists($model)) {
111 111
             throw LoadException::modelNotFound($model);
112 112
         }
113 113
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $controller = explode('/', $controller);
126 126
 
127 127
         $con                                = ucfirst(end($controller));
128
-        $con                                = (! preg_match('#Controller$#', $con)) ? $con . 'Controller' : $con;
128
+        $con                                = (!preg_match('#Controller$#', $con)) ? $con . 'Controller' : $con;
129 129
         $controller[count($controller) - 1] = $con;
130 130
 
131 131
         foreach ($controller as $key => &$value) {
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
         $path = CONTROLLER_PATH . Helpers::ensureExt(implode(DS, $controller), 'php');
138 138
 
139
-        if (! file_exists($path)) {
139
+        if (!file_exists($path)) {
140 140
             throw LoadException::controllerNotFound(str_replace('Controller', '', $con), $path);
141 141
         }
142 142
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         if (class_exists($class_namespaced, false)) {
148 148
             return Injector::make($class_namespaced);
149 149
         }
150
-        if (! class_exists($con, false)) {
150
+        if (!class_exists($con, false)) {
151 151
             throw LoadException::controllerDontExist(str_replace('Controller', '', $con), $path);
152 152
         }
153 153
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     protected static function verifyPreferApp(array $options, string $name): bool
177 177
     {
178 178
         // Tout element sans restriction passe
179
-        if (! $options['preferApp']) {
179
+        if (!$options['preferApp']) {
180 180
             return true;
181 181
         }
182 182
 
Please login to merge, or discard this patch.
src/Http/Concerns/InteractsWithContentTypes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
      */
32 32
     public function expectsJson(): bool
33 33
     {
34
-        return ($this->ajax() && ! $this->pjax() && $this->acceptsAnyContentType()) || $this->wantsJson();
34
+        return ($this->ajax() && !$this->pjax() && $this->acceptsAnyContentType()) || $this->wantsJson();
35 35
     }
36 36
 
37 37
     /**
Please login to merge, or discard this patch.