Passed
Pull Request — main (#15)
by
unknown
19:56 queued 15:33
created
src/View/Adapters/AbstractAdapter.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     {
79 79
         helper('assets');
80 80
 
81
-        if (! empty($viewPathLocator)) {
81
+        if (!empty($viewPathLocator)) {
82 82
             if (is_string($viewPathLocator)) {
83 83
                 $this->viewPath = rtrim($viewPathLocator, '\\/ ') . DS;
84 84
             } elseif ($viewPathLocator instanceof LocatorInterface) {
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             }
87 87
         }
88 88
 
89
-        if (empty($this->locator) && ! is_dir($this->viewPath)) {
89
+        if (empty($this->locator) && !is_dir($this->viewPath)) {
90 90
             $this->viewPath = '';
91 91
             $this->locator  = Services::locator();
92 92
         }
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
         $ext ??= $this->ext;
262 262
 
263 263
         $viewPath = $options['viewPath'] ?? $this->viewPath;
264
-        if (! empty($viewPath)) {
264
+        if (!empty($viewPath)) {
265 265
             $file = str_replace('/', DS, rtrim($viewPath, '/\\') . DS . ltrim($view, '/\\'));
266 266
         } else {
267 267
             $file = $view;
@@ -269,14 +269,14 @@  discard block
 block discarded – undo
269 269
 
270 270
         $file = Helpers::ensureExt($file, $ext);
271 271
 
272
-        if (! is_file($file) && $this->locator instanceof LocatorInterface) {
272
+        if (!is_file($file) && $this->locator instanceof LocatorInterface) {
273 273
             $file = $this->locator->locateFile($view, 'Views', $ext);
274 274
         }
275 275
 
276 276
         $file = realpath($file);
277 277
 
278 278
         // locateFile renverra une chaîne vide si le fichier est introuvable.
279
-        if (! is_file($file)) {
279
+        if (!is_file($file)) {
280 280
             throw ViewException::invalidFile($view);
281 281
         }
282 282
 
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
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
         $this->renderVars['file'] = $this->getRenderedFile($options, $this->renderVars['view'], $this->ext);
67 67
 
68
-        if (! empty($layout = $this->layout)) {
68
+        if (!empty($layout = $this->layout)) {
69 69
             if (empty(pathinfo($layout, PATHINFO_EXTENSION))) {
70 70
                 $layout .= '.' . $this->ext;
71 71
             }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         $this->engine->assign($this->data);
76 76
 
77 77
         // Doit-on mettre en cache?
78
-        if (! empty($this->renderVars['options']['cache_name']) || ! empty($this->renderVars['options']['cache'])) {
78
+        if (!empty($this->renderVars['options']['cache_name']) || !empty($this->renderVars['options']['cache'])) {
79 79
             $this->enableCache();
80 80
             $this->engine->setCacheLifetime(60 * ($this->renderVars['options']['cache'] ?? 60));
81 81
             $this->engine->setCompileId($this->renderVars['options']['cache_name'] ?? null);
Please login to merge, or discard this patch.
src/View/ViewDecoratorTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     protected function decorate(string $output): string
22 22
     {
23 23
         foreach (config('view.decorators') as $decorator) {
24
-            if (! is_subclass_of($decorator, ViewDecoratorInterface::class, true)) {
24
+            if (!is_subclass_of($decorator, ViewDecoratorInterface::class, true)) {
25 25
                 throw ViewException::invalidDecorator($decorator);
26 26
             }
27 27
 
Please login to merge, or discard this patch.
src/View/View.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
         $data = array_merge(self::$shared, $data);
217 217
 
218
-        if (! on_test() && ! isset($data['errors'])) {
218
+        if (!on_test() && !isset($data['errors'])) {
219 219
             $data['errors'] = $this->setValidationErrors();
220 220
         }
221 221
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         if (is_string($errors)) {
247 247
             $errors = ['default' => $errors];
248 248
         }
249
-        if (! ($errors instanceof ErrorBag)) {
249
+        if (!($errors instanceof ErrorBag)) {
250 250
             $errors = new ErrorBag($errors);
251 251
         }
252 252
 
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 
285 285
         $data = array_merge(self::$shared, $data);
286 286
 
287
-        if (! on_test() && ! isset($data['errors'])) {
287
+        if (!on_test() && !isset($data['errors'])) {
288 288
             $data['errors'] = $this->setValidationErrors();
289 289
         }
290 290
 
@@ -342,10 +342,10 @@  discard block
 block discarded – undo
342 342
      */
343 343
     public function setAdapter(string $adapter, array $config = []): static
344 344
     {
345
-        if (! array_key_exists($adapter, self::$validAdapters)) {
345
+        if (!array_key_exists($adapter, self::$validAdapters)) {
346 346
             $adapter = 'native';
347 347
         }
348
-        if (empty($this->config['adapters']) || ! is_array($this->config['adapters'])) {
348
+        if (empty($this->config['adapters']) || !is_array($this->config['adapters'])) {
349 349
             $this->config['adapters'] = [];
350 350
         }
351 351
 
Please login to merge, or discard this patch.
src/Helpers/path.php 1 patch
Spacing   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * the LICENSE file that was distributed with this source code.
10 10
  */
11 11
 
12
-if (! function_exists('css_path')) {
12
+if (!function_exists('css_path')) {
13 13
     /**
14 14
      * CSS PATH
15 15
      *
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
      */
20 20
     function css_path(string $name = ''): string
21 21
     {
22
-        if (! empty($name)) {
22
+        if (!empty($name)) {
23 23
             $name = ltrim($name, '/\\');
24 24
 
25 25
             if (empty(pathinfo($name, PATHINFO_EXTENSION))) {
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     }
32 32
 }
33 33
 
34
-if (! function_exists('js_path')) {
34
+if (!function_exists('js_path')) {
35 35
     /**
36 36
      * JS PATH
37 37
      *
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     function js_path(string $name = ''): string
43 43
     {
44
-        if (! empty($name)) {
44
+        if (!empty($name)) {
45 45
             $name = ltrim($name, '/\\');
46 46
 
47 47
             if (empty(pathinfo($name, PATHINFO_EXTENSION))) {
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     }
54 54
 }
55 55
 
56
-if (! function_exists('lib_path')) {
56
+if (!function_exists('lib_path')) {
57 57
     /**
58 58
      * LIB PATH
59 59
      *
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     function lib_path(string $name = ''): string
65 65
     {
66
-        if (! empty($name)) {
66
+        if (!empty($name)) {
67 67
             $name = ltrim($name, '/\\');
68 68
         }
69 69
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     }
72 72
 }
73 73
 
74
-if (! function_exists('less_path')) {
74
+if (!function_exists('less_path')) {
75 75
     /**
76 76
      * LESS PATH
77 77
      *
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     function less_path(string $name = ''): string
83 83
     {
84
-        if (! empty($name)) {
84
+        if (!empty($name)) {
85 85
             $name = ltrim($name, '/\\');
86 86
 
87 87
             if (empty(pathinfo($name, PATHINFO_EXTENSION))) {
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     }
94 94
 }
95 95
 
96
-if (! function_exists('img_path')) {
96
+if (!function_exists('img_path')) {
97 97
     /**
98 98
      * IMG PATH
99 99
      *
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      */
104 104
     function img_path(string $name = ''): string
105 105
     {
106
-        if (! empty($name)) {
106
+        if (!empty($name)) {
107 107
             $name = ltrim($name, '/\\');
108 108
         }
109 109
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     }
112 112
 }
113 113
 
114
-if (! function_exists('docs_path')) {
114
+if (!function_exists('docs_path')) {
115 115
     /**
116 116
      * DOCS PATH
117 117
      *
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      */
122 122
     function docs_path(string $name = ''): string
123 123
     {
124
-        if (! empty($name)) {
124
+        if (!empty($name)) {
125 125
             $name = ltrim($name, '/\\');
126 126
         }
127 127
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     }
130 130
 }
131 131
 
132
-if (! function_exists('video_path')) {
132
+if (!function_exists('video_path')) {
133 133
     /**
134 134
      * VIDEO PATH
135 135
      *
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      */
140 140
     function video_path(string $name = ''): string
141 141
     {
142
-        if (! empty($name)) {
142
+        if (!empty($name)) {
143 143
             $name = ltrim($name, '/\\');
144 144
         }
145 145
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     }
148 148
 }
149 149
 
150
-if (! function_exists('public_path')) {
150
+if (!function_exists('public_path')) {
151 151
     /**
152 152
      * PUBLIC PATH
153 153
      *
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      */
158 158
     function public_path(string $name = ''): string
159 159
     {
160
-        if (! empty($name)) {
160
+        if (!empty($name)) {
161 161
             $name = ltrim($name, '/\\');
162 162
         }
163 163
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     }
166 166
 }
167 167
 
168
-if (! function_exists('root_path')) {
168
+if (!function_exists('root_path')) {
169 169
     /**
170 170
      * ROOT PATH
171 171
      *
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
      */
176 176
     function root_path(string $name = ''): string
177 177
     {
178
-        if (! empty($name)) {
178
+        if (!empty($name)) {
179 179
             $name = ltrim($name, '/\\');
180 180
         }
181 181
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
     }
184 184
 }
185 185
 
186
-if (! function_exists('base_path')) {
186
+if (!function_exists('base_path')) {
187 187
     /**
188 188
      * BASE PATH
189 189
      *
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      */
194 194
     function base_path(string $name = ''): string
195 195
     {
196
-        if (! empty($name)) {
196
+        if (!empty($name)) {
197 197
             $name = ltrim($name, '/\\');
198 198
         }
199 199
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
     }
202 202
 }
203 203
 
204
-if (! function_exists('resource_path')) {
204
+if (!function_exists('resource_path')) {
205 205
     /**
206 206
      * BASE RESOURCE PATH
207 207
      *
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
      */
212 212
     function resource_path(string $name = ''): string
213 213
     {
214
-        if (! empty($name)) {
214
+        if (!empty($name)) {
215 215
             $name = ltrim($name, '/\\');
216 216
         }
217 217
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
     }
220 220
 }
221 221
 
222
-if (! function_exists('class_path')) {
222
+if (!function_exists('class_path')) {
223 223
     /**
224 224
      * CLASS PATH
225 225
      *
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
      */
230 230
     function class_path(string $name = ''): string
231 231
     {
232
-        if (! empty($name)) {
232
+        if (!empty($name)) {
233 233
             $name = ltrim($name, '/\\');
234 234
         }
235 235
 
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
     }
238 238
 }
239 239
 
240
-if (! function_exists('config_path')) {
240
+if (!function_exists('config_path')) {
241 241
     /**
242 242
      * CONFIG PATH
243 243
      *
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
      */
248 248
     function config_path(string $name = ''): string
249 249
     {
250
-        if (! empty($name)) {
250
+        if (!empty($name)) {
251 251
             $name = ltrim($name, '/\\');
252 252
 
253 253
             if (empty(pathinfo($name, PATHINFO_EXTENSION))) {
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
     }
260 260
 }
261 261
 
262
-if (! function_exists('controller_path')) {
262
+if (!function_exists('controller_path')) {
263 263
     /**
264 264
      * CONTROLLER PATH
265 265
      *
@@ -270,10 +270,10 @@  discard block
 block discarded – undo
270 270
      */
271 271
     function controller_path(string $name = '', bool $only = true): string
272 272
     {
273
-        if (! empty($name)) {
273
+        if (!empty($name)) {
274 274
             $name = ltrim($name, '/\\');
275 275
 
276
-            if ($only === true && ! preg_match('#Controller\.php$#', $name)) {
276
+            if ($only === true && !preg_match('#Controller\.php$#', $name)) {
277 277
                 $name = ucfirst(strtolower($name)) . 'Controller.php';
278 278
             }
279 279
         }
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
     }
283 283
 }
284 284
 
285
-if (! function_exists('entity_path')) {
285
+if (!function_exists('entity_path')) {
286 286
     /**
287 287
      * ENTITY PATH
288 288
      *
@@ -293,10 +293,10 @@  discard block
 block discarded – undo
293 293
      */
294 294
     function entity_path(string $name = '', bool $only = true): string
295 295
     {
296
-        if (! empty($name)) {
296
+        if (!empty($name)) {
297 297
             $name = ltrim($name, '/\\');
298 298
 
299
-            if ($only === true && ! preg_match('#Entity\.php$#', $name)) {
299
+            if ($only === true && !preg_match('#Entity\.php$#', $name)) {
300 300
                 $name = ucfirst($name) . 'Entity.php';
301 301
             }
302 302
         }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
     }
306 306
 }
307 307
 
308
-if (! function_exists('helper_path')) {
308
+if (!function_exists('helper_path')) {
309 309
     /**
310 310
      * HELPER PATH
311 311
      *
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
      */
317 317
     function helper_path(string $name = '', bool $system = false): string
318 318
     {
319
-        if (! empty($name)) {
319
+        if (!empty($name)) {
320 320
             $name = ltrim($name, '/\\');
321 321
 
322 322
             if (empty(pathinfo($name, PATHINFO_EXTENSION))) {
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
     }
332 332
 }
333 333
 
334
-if (! function_exists('library_path')) {
334
+if (!function_exists('library_path')) {
335 335
     /**
336 336
      * LIBRARY PATH
337 337
      *
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
      */
343 343
     function library_path(string $name = '', bool $system = false): string
344 344
     {
345
-        if (! empty($name)) {
345
+        if (!empty($name)) {
346 346
             $name = ltrim($name, '/\\');
347 347
 
348 348
             if (empty(pathinfo($name, PATHINFO_EXTENSION))) {
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
     }
359 359
 }
360 360
 
361
-if (! function_exists('middleware_path')) {
361
+if (!function_exists('middleware_path')) {
362 362
     /**
363 363
      * MIDDLEWARE PATH
364 364
      *
@@ -370,10 +370,10 @@  discard block
 block discarded – undo
370 370
      */
371 371
     function middleware_path(string $name = '', bool $system = false, bool $only = true): string
372 372
     {
373
-        if (! empty($name)) {
373
+        if (!empty($name)) {
374 374
             $name = ltrim($name, '/\\');
375 375
 
376
-            if ($only === true && ! preg_match('#Middleware\.php$#', $name)) {
376
+            if ($only === true && !preg_match('#Middleware\.php$#', $name)) {
377 377
                 $name = ucfirst($name) . 'Middleware.php';
378 378
             }
379 379
         }
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
     }
386 386
 }
387 387
 
388
-if (! function_exists('model_path')) {
388
+if (!function_exists('model_path')) {
389 389
     /**
390 390
      * MODEL PATH
391 391
      *
@@ -396,10 +396,10 @@  discard block
 block discarded – undo
396 396
      */
397 397
     function model_path(string $name = '', bool $only = true): string
398 398
     {
399
-        if (! empty($name)) {
399
+        if (!empty($name)) {
400 400
             $name = ltrim($name, '/\\');
401 401
 
402
-            if ($only === true && ! preg_match('#Model\.php$#', $name)) {
402
+            if ($only === true && !preg_match('#Model\.php$#', $name)) {
403 403
                 $name = ucfirst(strtolower($name)) . 'Model.php';
404 404
             }
405 405
         }
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
     }
409 409
 }
410 410
 
411
-if (! function_exists('app_resource_path')) {
411
+if (!function_exists('app_resource_path')) {
412 412
     /**
413 413
      * APP RESOURCE PATH
414 414
      *
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
      */
419 419
     function app_resource_path(string $name = ''): string
420 420
     {
421
-        if (! empty($name)) {
421
+        if (!empty($name)) {
422 422
             $name = ltrim($name, '/\\');
423 423
         }
424 424
 
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
     }
427 427
 }
428 428
 
429
-if (! function_exists('migration_path')) {
429
+if (!function_exists('migration_path')) {
430 430
     /**
431 431
      * MIGRATION PATH
432 432
      *
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
      */
437 437
     function migration_path(string $name = ''): string
438 438
     {
439
-        if (! empty($name)) {
439
+        if (!empty($name)) {
440 440
             $name = ltrim($name, '/\\');
441 441
         }
442 442
 
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
     }
445 445
 }
446 446
 
447
-if (! function_exists('seed_path')) {
447
+if (!function_exists('seed_path')) {
448 448
     /**
449 449
      * SEED PATH
450 450
      *
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
      */
455 455
     function seed_path(string $name = ''): string
456 456
     {
457
-        if (! empty($name)) {
457
+        if (!empty($name)) {
458 458
             $name = ltrim($name, '/\\');
459 459
         }
460 460
 
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
     }
463 463
 }
464 464
 
465
-if (! function_exists('lang_path')) {
465
+if (!function_exists('lang_path')) {
466 466
     /**
467 467
      * LANG PATH
468 468
      *
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
      */
474 474
     function lang_path(string $name = '', bool $system = false): string
475 475
     {
476
-        if (! empty($name)) {
476
+        if (!empty($name)) {
477 477
             $name = ltrim($name, '/\\');
478 478
         }
479 479
         if ($system === true) {
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
     }
485 485
 }
486 486
 
487
-if (! function_exists('service_path')) {
487
+if (!function_exists('service_path')) {
488 488
     /**
489 489
      * SERVICE PATH
490 490
      *
@@ -495,10 +495,10 @@  discard block
 block discarded – undo
495 495
      */
496 496
     function service_path(string $name = '', bool $only = true): string
497 497
     {
498
-        if (! empty($name)) {
498
+        if (!empty($name)) {
499 499
             $name = ltrim($name, '/\\');
500 500
 
501
-            if ($only === true && ! preg_match('#Service\.php$#', $name)) {
501
+            if ($only === true && !preg_match('#Service\.php$#', $name)) {
502 502
                 $name = ucfirst($name) . 'Service.php';
503 503
             }
504 504
         }
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
     }
508 508
 }
509 509
 
510
-if (! function_exists('view_path')) {
510
+if (!function_exists('view_path')) {
511 511
     /**
512 512
      * VIEW PATH
513 513
      *
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
      */
518 518
     function view_path(string $name = ''): string
519 519
     {
520
-        if (! empty($name)) {
520
+        if (!empty($name)) {
521 521
             $name = ltrim($name, '/\\');
522 522
         }
523 523
 
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
     }
526 526
 }
527 527
 
528
-if (! function_exists('layout_path')) {
528
+if (!function_exists('layout_path')) {
529 529
     /**
530 530
      * LAYOUT PATH
531 531
      *
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
      */
536 536
     function layout_path(string $name = ''): string
537 537
     {
538
-        if (! empty($name)) {
538
+        if (!empty($name)) {
539 539
             $name = ltrim($name, '/\\');
540 540
         }
541 541
 
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
     }
544 544
 }
545 545
 
546
-if (! function_exists('partial_path')) {
546
+if (!function_exists('partial_path')) {
547 547
     /**
548 548
      * PARTIAL PATH
549 549
      *
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
      */
554 554
     function partial_path(string $name = ''): string
555 555
     {
556
-        if (! empty($name)) {
556
+        if (!empty($name)) {
557 557
             $name = ltrim($name, '/\\');
558 558
         }
559 559
 
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
     }
562 562
 }
563 563
 
564
-if (! function_exists('app_path')) {
564
+if (!function_exists('app_path')) {
565 565
     /**
566 566
      * APP PATH
567 567
      *
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
      */
572 572
     function app_path(string $name = ''): string
573 573
     {
574
-        if (! empty($name)) {
574
+        if (!empty($name)) {
575 575
             $name = ltrim($name, '/\\');
576 576
         }
577 577
 
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
     }
580 580
 }
581 581
 
582
-if (! function_exists('cache_path')) {
582
+if (!function_exists('cache_path')) {
583 583
     /**
584 584
      * CACHE PATH
585 585
      *
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
      */
590 590
     function cache_path(string $name = ''): string
591 591
     {
592
-        if (! empty($name)) {
592
+        if (!empty($name)) {
593 593
             $name = ltrim($name, '/\\');
594 594
         }
595 595
 
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
     }
598 598
 }
599 599
 
600
-if (! function_exists('dump_path')) {
600
+if (!function_exists('dump_path')) {
601 601
     /**
602 602
      * DUMP PATH
603 603
      *
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
      */
608 608
     function dump_path(string $name = ''): string
609 609
     {
610
-        if (! empty($name)) {
610
+        if (!empty($name)) {
611 611
             $name = ltrim($name, '/\\');
612 612
         }
613 613
 
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
     }
616 616
 }
617 617
 
618
-if (! function_exists('storage_path')) {
618
+if (!function_exists('storage_path')) {
619 619
     /**
620 620
      * STORAGE PATH
621 621
      *
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
      */
626 626
     function storage_path(string $name = ''): string
627 627
     {
628
-        if (! empty($name)) {
628
+        if (!empty($name)) {
629 629
             $name = ltrim($name, '/\\');
630 630
         }
631 631
 
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
     }
634 634
 }
635 635
 
636
-if (! function_exists('css_exist')) {
636
+if (!function_exists('css_exist')) {
637 637
     /**
638 638
      * CSS EXIST
639 639
      *
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
     }
648 648
 }
649 649
 
650
-if (! function_exists('js_exist')) {
650
+if (!function_exists('js_exist')) {
651 651
     /**
652 652
      * JS EXIST
653 653
      *
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
     }
662 662
 }
663 663
 
664
-if (! function_exists('lib_exist')) {
664
+if (!function_exists('lib_exist')) {
665 665
     /**
666 666
      * LIB EXIST
667 667
      *
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
     }
676 676
 }
677 677
 
678
-if (! function_exists('less_exist')) {
678
+if (!function_exists('less_exist')) {
679 679
     /**
680 680
      * LESS EXIST
681 681
      *
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
     }
690 690
 }
691 691
 
692
-if (! function_exists('img_exist')) {
692
+if (!function_exists('img_exist')) {
693 693
     /**
694 694
      * IMG EXIST
695 695
      *
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
     }
704 704
 }
705 705
 
706
-if (! function_exists('doc_exist')) {
706
+if (!function_exists('doc_exist')) {
707 707
     /**
708 708
      * DOC EXIST
709 709
      *
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
     }
718 718
 }
719 719
 
720
-if (! function_exists('video_exist')) {
720
+if (!function_exists('video_exist')) {
721 721
     /**
722 722
      * VIDEO EXIST
723 723
      *
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
     }
732 732
 }
733 733
 
734
-if (! function_exists('public_exist')) {
734
+if (!function_exists('public_exist')) {
735 735
     /**
736 736
      * PUBLIC EXIST
737 737
      *
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
     }
746 746
 }
747 747
 
748
-if (! function_exists('class_exist')) {
748
+if (!function_exists('class_exist')) {
749 749
     /**
750 750
      * CLASS EXIST
751 751
      *
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
     }
760 760
 }
761 761
 
762
-if (! function_exists('config_exist')) {
762
+if (!function_exists('config_exist')) {
763 763
     /**
764 764
      * CONFIG EXIST
765 765
      *
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
     }
774 774
 }
775 775
 
776
-if (! function_exists('controller_exist')) {
776
+if (!function_exists('controller_exist')) {
777 777
     /**
778 778
      * CONTROLLER EXIST
779 779
      *
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
     }
789 789
 }
790 790
 
791
-if (! function_exists('entity_exist')) {
791
+if (!function_exists('entity_exist')) {
792 792
     /**
793 793
      * ENTITY EXIST
794 794
      *
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
     }
804 804
 }
805 805
 
806
-if (! function_exists('helper_exist')) {
806
+if (!function_exists('helper_exist')) {
807 807
     /**
808 808
      * HELPER EXIST
809 809
      *
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
     }
819 819
 }
820 820
 
821
-if (! function_exists('library_exist')) {
821
+if (!function_exists('library_exist')) {
822 822
     /**
823 823
      * LIBRARY EXIST
824 824
      *
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
     }
834 834
 }
835 835
 
836
-if (! function_exists('middleware_exist')) {
836
+if (!function_exists('middleware_exist')) {
837 837
     /**
838 838
      * MIDDLEWARE EXIST
839 839
      *
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
     }
850 850
 }
851 851
 
852
-if (! function_exists('model_exist')) {
852
+if (!function_exists('model_exist')) {
853 853
     /**
854 854
      * MODEL EXIST
855 855
      *
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
     }
865 865
 }
866 866
 
867
-if (! function_exists('resource_exist')) {
867
+if (!function_exists('resource_exist')) {
868 868
     /**
869 869
      * RESOURCE EXIST
870 870
      *
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
     }
879 879
 }
880 880
 
881
-if (! function_exists('migration_exist')) {
881
+if (!function_exists('migration_exist')) {
882 882
     /**
883 883
      * MIGRATION EXIST
884 884
      *
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
     }
893 893
 }
894 894
 
895
-if (! function_exists('seed_exist')) {
895
+if (!function_exists('seed_exist')) {
896 896
     /**
897 897
      * SEED EXIST
898 898
      *
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
     }
907 907
 }
908 908
 
909
-if (! function_exists('lang_exist')) {
909
+if (!function_exists('lang_exist')) {
910 910
     /**
911 911
      * LANG EXIST
912 912
      *
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
     }
922 922
 }
923 923
 
924
-if (! function_exists('service_exist')) {
924
+if (!function_exists('service_exist')) {
925 925
     /**
926 926
      * SERVICE EXIST
927 927
      *
@@ -936,7 +936,7 @@  discard block
 block discarded – undo
936 936
     }
937 937
 }
938 938
 
939
-if (! function_exists('view_exist')) {
939
+if (!function_exists('view_exist')) {
940 940
     /**
941 941
      * VIEW EXIST
942 942
      *
@@ -950,7 +950,7 @@  discard block
 block discarded – undo
950 950
     }
951 951
 }
952 952
 
953
-if (! function_exists('layout_exist')) {
953
+if (!function_exists('layout_exist')) {
954 954
     /**
955 955
      * LAYOUT EXIST
956 956
      *
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
     }
965 965
 }
966 966
 
967
-if (! function_exists('partial_exist')) {
967
+if (!function_exists('partial_exist')) {
968 968
     /**
969 969
      * PARTIAL EXIST
970 970
      *
@@ -978,7 +978,7 @@  discard block
 block discarded – undo
978 978
     }
979 979
 }
980 980
 
981
-if (! function_exists('app_exist')) {
981
+if (!function_exists('app_exist')) {
982 982
     /**
983 983
      * APP EXIST
984 984
      *
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
     }
993 993
 }
994 994
 
995
-if (! function_exists('cache_exist')) {
995
+if (!function_exists('cache_exist')) {
996 996
     /**
997 997
      * CACHE EXIST
998 998
      *
@@ -1006,7 +1006,7 @@  discard block
 block discarded – undo
1006 1006
     }
1007 1007
 }
1008 1008
 
1009
-if (! function_exists('dump_exist')) {
1009
+if (!function_exists('dump_exist')) {
1010 1010
     /**
1011 1011
      * DUMP EXIST
1012 1012
      *
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
     }
1021 1021
 }
1022 1022
 
1023
-if (! function_exists('storage_exist')) {
1023
+if (!function_exists('storage_exist')) {
1024 1024
     /**
1025 1025
      * STORAGE EXIST
1026 1026
      *
@@ -1034,7 +1034,7 @@  discard block
 block discarded – undo
1034 1034
     }
1035 1035
 }
1036 1036
 
1037
-if (! function_exists('include_config')) {
1037
+if (!function_exists('include_config')) {
1038 1038
     /**
1039 1039
      * INCLUDE CONFIG
1040 1040
      *
@@ -1052,7 +1052,7 @@  discard block
 block discarded – undo
1052 1052
     }
1053 1053
 }
1054 1054
 
1055
-if (! function_exists('include_controller')) {
1055
+if (!function_exists('include_controller')) {
1056 1056
     /**
1057 1057
      * INCLUDE CONTROLLER
1058 1058
      *
@@ -1071,7 +1071,7 @@  discard block
 block discarded – undo
1071 1071
     }
1072 1072
 }
1073 1073
 
1074
-if (! function_exists('include_class')) {
1074
+if (!function_exists('include_class')) {
1075 1075
     /**
1076 1076
      * INCLUDE CLASS
1077 1077
      *
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
     }
1090 1090
 }
1091 1091
 
1092
-if (! function_exists('include_entity')) {
1092
+if (!function_exists('include_entity')) {
1093 1093
     /**
1094 1094
      * INCLUDE ENTITY
1095 1095
      *
@@ -1108,7 +1108,7 @@  discard block
 block discarded – undo
1108 1108
     }
1109 1109
 }
1110 1110
 
1111
-if (! function_exists('include_helper')) {
1111
+if (!function_exists('include_helper')) {
1112 1112
     /**
1113 1113
      * INCLUDE HELPER
1114 1114
      *
@@ -1126,7 +1126,7 @@  discard block
 block discarded – undo
1126 1126
     }
1127 1127
 }
1128 1128
 
1129
-if (! function_exists('include_library')) {
1129
+if (!function_exists('include_library')) {
1130 1130
     /**
1131 1131
      * INCLUDE LIBRARY
1132 1132
      *
@@ -1145,7 +1145,7 @@  discard block
 block discarded – undo
1145 1145
     }
1146 1146
 }
1147 1147
 
1148
-if (! function_exists('include_middleware')) {
1148
+if (!function_exists('include_middleware')) {
1149 1149
     /**
1150 1150
      * INCLUDE MIDDLEWARE
1151 1151
      *
@@ -1165,7 +1165,7 @@  discard block
 block discarded – undo
1165 1165
     }
1166 1166
 }
1167 1167
 
1168
-if (! function_exists('include_model')) {
1168
+if (!function_exists('include_model')) {
1169 1169
     /**
1170 1170
      * INCLUDE MODEL
1171 1171
      *
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
     }
1185 1185
 }
1186 1186
 
1187
-if (! function_exists('include_resource')) {
1187
+if (!function_exists('include_resource')) {
1188 1188
     /**
1189 1189
      * INCLUDE RESOURCE
1190 1190
      *
@@ -1202,7 +1202,7 @@  discard block
 block discarded – undo
1202 1202
     }
1203 1203
 }
1204 1204
 
1205
-if (! function_exists('include_service')) {
1205
+if (!function_exists('include_service')) {
1206 1206
     /**
1207 1207
      * INCLUDE SERVICE
1208 1208
      *
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
     }
1222 1222
 }
1223 1223
 
1224
-if (! function_exists('include_view')) {
1224
+if (!function_exists('include_view')) {
1225 1225
     /**
1226 1226
      * INCLUDE VIEW
1227 1227
      *
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
     }
1240 1240
 }
1241 1241
 
1242
-if (! function_exists('include_layout')) {
1242
+if (!function_exists('include_layout')) {
1243 1243
     /**
1244 1244
      * INCLUDE LAYOUT
1245 1245
      *
@@ -1257,7 +1257,7 @@  discard block
 block discarded – undo
1257 1257
     }
1258 1258
 }
1259 1259
 
1260
-if (! function_exists('include_partial')) {
1260
+if (!function_exists('include_partial')) {
1261 1261
     /**
1262 1262
      * INCLUDE PARTIAL
1263 1263
      *
@@ -1275,7 +1275,7 @@  discard block
 block discarded – undo
1275 1275
     }
1276 1276
 }
1277 1277
 
1278
-if (! function_exists('_include_path')) {
1278
+if (!function_exists('_include_path')) {
1279 1279
     /**
1280 1280
      * inclus un fichier
1281 1281
      *
Please login to merge, or discard this patch.
src/Config/Config.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function exists(string $key): bool
63 63
     {
64
-        if (! $this->configurator->exists($key)) {
64
+        if (!$this->configurator->exists($key)) {
65 65
             $config = explode('.', $key);
66 66
             $this->load($config[0]);
67 67
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function missing(string $key): bool
86 86
     {
87
-        return ! $this->exists($key);
87
+        return !$this->exists($key);
88 88
     }
89 89
 
90 90
     /**
@@ -167,18 +167,18 @@  discard block
 block discarded – undo
167 167
                 }
168 168
                 $this->load($conf, $file, null, $allow_empty);
169 169
             }
170
-        } elseif (! isset(self::$loaded[$config])) {
170
+        } elseif (!isset(self::$loaded[$config])) {
171 171
             $file ??= self::path($config);
172 172
             $schema ??= self::schema($config);
173 173
 
174 174
             $configurations = [];
175
-            if (file_exists($file) && ! in_array($file, get_included_files(), true)) {
175
+            if (file_exists($file) && !in_array($file, get_included_files(), true)) {
176 176
                 $configurations = (array) require $file;
177 177
             }
178 178
 
179 179
             $configurations = Arr::merge(self::$registrars[$config] ?? [], $configurations);
180 180
 
181
-            if (empty($configurations) && ! $allow_empty && (empty($schema) || ! is_a($schema, Schema::class))) {
181
+            if (empty($configurations) && !$allow_empty && (empty($schema) || !is_a($schema, Schema::class))) {
182 182
                 return;
183 183
             }
184 184
 
@@ -279,14 +279,14 @@  discard block
 block discarded – undo
279 279
             }
280 280
 
281 281
             $class   = new ReflectionClass($classname);
282
-            $methods = $class->getMethods(ReflectionMethod::IS_STATIC | ReflectionMethod::IS_PUBLIC);
282
+            $methods = $class->getMethods(ReflectionMethod::IS_STATIC|ReflectionMethod::IS_PUBLIC);
283 283
 
284 284
             foreach ($methods as $method) {
285
-                if (! ($method->isPublic() && $method->isStatic())) {
285
+                if (!($method->isPublic() && $method->isStatic())) {
286 286
                     continue;
287 287
                 }
288 288
 
289
-                if (! is_array($result = $method->invoke(null))) {
289
+                if (!is_array($result = $method->invoke(null))) {
290 290
                     continue;
291 291
                 }
292 292
 
@@ -355,12 +355,12 @@  discard block
 block discarded – undo
355 355
     {
356 356
         $config = $this->get('app.show_debugbar', 'auto');
357 357
 
358
-        if (! in_array($config, ['auto', true, false], true)) {
358
+        if (!in_array($config, ['auto', true, false], true)) {
359 359
             self::exceptBadConfigValue('show_debugbar', ['auto', true, false], 'app');
360 360
         }
361 361
 
362 362
         if ($config === 'auto') {
363
-            $this->set('app.show_debugbar', ! is_online());
363
+            $this->set('app.show_debugbar', !is_online());
364 364
         }
365 365
     }
366 366
 
Please login to merge, or discard this patch.
src/Http/UrlGenerator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 
271 271
         $route = $this->routes->reverseRoute($action, ...$parameters);
272 272
 
273
-        if (! $route) {
273
+        if (!$route) {
274 274
             throw RouterException::actionNotDefined($action);
275 275
         }
276 276
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
      */
342 342
     public function isValidUrl(string $path): bool
343 343
     {
344
-        if (! preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)) {
344
+        if (!preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)) {
345 345
             return filter_var($path, FILTER_VALIDATE_URL) !== false;
346 346
         }
347 347
 
Please login to merge, or discard this patch.
src/Middlewares/BaseMiddleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         $this->path = $path;
36 36
 
37 37
         foreach ($this->arguments as $argument => $value) {
38
-            if (! is_string($argument)) {
38
+            if (!is_string($argument)) {
39 39
                 continue;
40 40
             }
41 41
 
Please login to merge, or discard this patch.
src/Controllers/ApplicationController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $options = (array) $options;
46 46
 
47 47
         // N'est-il pas namespaced ? on cherche le dossier en fonction du controleur
48
-        if (! str_contains($view, '\\')) {
48
+        if (!str_contains($view, '\\')) {
49 49
             $reflection                                      = new ReflectionClass(static::class);
50 50
             ['dirname' => $dirname, 'filename' => $filename] = pathinfo($reflection->getFileName());
51 51
             $dirname                                         = str_ireplace('Controllers', 'Views', $dirname);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             $dirname = implode('Views', $parts);
60 60
             $path    = implode(DS, [$dirname, $filename]) . DS;
61 61
             
62
-            if (! is_dir($path)) {
62
+            if (!is_dir($path)) {
63 63
                 $path = implode(DS, [$dirname]) . DS;
64 64
             }
65 65
         }
@@ -72,12 +72,12 @@  discard block
 block discarded – undo
72 72
             $viewer->layout($this->layout);
73 73
         }
74 74
 
75
-        if (! empty($this->viewDatas) && is_array($this->viewDatas)) {
75
+        if (!empty($this->viewDatas) && is_array($this->viewDatas)) {
76 76
             $viewer->addData($this->viewDatas);
77 77
         }
78 78
 
79 79
         if (empty($data['title'])) {
80
-            if (! is_string($controllerName = Dispatcher::getController(false))) {
80
+            if (!is_string($controllerName = Dispatcher::getController(false))) {
81 81
                 $controllerName = static::class;
82 82
             }
83 83
             $controllerName = str_ireplace(['App\Controllers', 'Controller'], '', $controllerName);
Please login to merge, or discard this patch.