Test Failed
Push — main ( 94eef3...96fa17 )
by Dimitri
14:06
created
src/Mail/Adapters/PHPMailer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     public function __construct(bool $debug = false)
33 33
     {
34 34
         $this->mailer              = new Mailer();
35
-        $this->mailer->Debugoutput = static function ($str, $level) {
35
+        $this->mailer->Debugoutput = static function($str, $level) {
36 36
             Services::logger()->info('[Mail][' . $level . ']: ' . $str);
37 37
         };
38 38
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public function init(array $config): self
46 46
     {
47
-        if (! empty($config['username']) && ! empty($config['password'])) {
47
+        if (!empty($config['username']) && !empty($config['password'])) {
48 48
             $this->mailer->SMTPAuth = true;
49 49
         }
50 50
 
Please login to merge, or discard this patch.
src/Debug/Toolbar.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $this->config = $config ?? (object) config('toolbar');
68 68
 
69 69
         foreach ($this->config->collectors as $collector) {
70
-            if (! class_exists($collector)) {
70
+            if (!class_exists($collector)) {
71 71
                 logger()->critical(
72 72
                     'Toolbar collector does not exist (' . $collector . ').'
73 73
                     . ' Please check $collectors in the app/Config/toolbar.php file.'
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             $data['vars']['varData'][esc($heading)] = $varData;
134 134
         }
135 135
 
136
-        if (! empty($_SESSION)) {
136
+        if (!empty($_SESSION)) {
137 137
             foreach ($_SESSION as $key => $value) {
138 138
                 // Remplacez les données binaires par une chaîne pour éviter l'échec de json_encode.
139 139
                 if (is_string($value) && preg_match('~[^\x20-\x7E\t\r\n]~', $value)) {
@@ -206,8 +206,8 @@  discard block
 block discarded – undo
206 206
         $output = '';
207 207
 
208 208
         foreach ($rows as $row) {
209
-            $hasChildren = isset($row['children']) && ! empty($row['children']);
210
-            $isQuery     = isset($row['query']) && ! empty($row['query']);
209
+            $hasChildren = isset($row['children']) && !empty($row['children']);
210
+            $isQuery     = isset($row['query']) && !empty($row['query']);
211 211
 
212 212
             // Ouvrir la chronologie du contrôleur par défaut
213 213
             $open = $row['name'] === 'Controller';
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
         // Le collecter
274 274
         foreach ($collectors as $collector) {
275
-            if (! $collector['hasTimelineData']) {
275
+            if (!$collector['hasTimelineData']) {
276 276
                 continue;
277 277
             }
278 278
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
         array_multisort(...$sortArray);
290 290
 
291 291
         // Ajouter une heure de fin à chaque élément
292
-        array_walk($data, static function (&$row) {
292
+        array_walk($data, static function(&$row) {
293 293
             $row['end'] = $row['start'] + $row['duration'];
294 294
         });
295 295
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
         $element = array_shift($elements);
309 309
 
310 310
         // Si nous avons des enfants derrière nous, récupérez-les et attachez-les-nous
311
-        while (! empty($elements) && $elements[array_key_first($elements)]['end'] <= $element['end']) {
311
+        while (!empty($elements) && $elements[array_key_first($elements)]['end'] <= $element['end']) {
312 312
             $element['children'][] = array_shift($elements);
313 313
         }
314 314
 
@@ -332,14 +332,14 @@  discard block
 block discarded – undo
332 332
      */
333 333
     protected function collectVarData(): array
334 334
     {
335
-        if (! ($this->config->collectVarData ?? true)) {
335
+        if (!($this->config->collectVarData ?? true)) {
336 336
             return [];
337 337
         }
338 338
 
339 339
         $data = [];
340 340
 
341 341
         foreach ($this->collectors as $collector) {
342
-            if (! $collector->hasVarData()) {
342
+            if (!$collector->hasVarData()) {
343 343
                 continue;
344 344
             }
345 345
 
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
         }
375 375
 
376 376
         // Si on a desactiver le debogage ou l'affichage de la debugbar, on s'arrete
377
-        if (! BLITZ_DEBUG || ! $this->config->show_debugbar) {
377
+        if (!BLITZ_DEBUG || !$this->config->show_debugbar) {
378 378
             return $response;
379 379
         }
380 380
 
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
         // Mise à jour vers microtime() pour que nous puissions obtenir l'historique
390 390
         $time = sprintf('%.6f', Date::now()->format('U.u'));
391 391
 
392
-        if (! is_dir($this->debugPath)) {
392
+        if (!is_dir($this->debugPath)) {
393 393
             mkdir($this->debugPath, 0o777);
394 394
         }
395 395
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 
400 400
         // Les formats non HTML ne doivent pas inclure la barre de débogage,
401 401
         // puis nous envoyons des en-têtes indiquant où trouver les données de débogage pour cette réponse
402
-        if ($request->ajax() || ! str_contains($format, 'html')) {
402
+        if ($request->ajax() || !str_contains($format, 'html')) {
403 403
             return $response
404 404
                 ->withHeader('Debugbar-Time', "{$time}")
405 405
                 ->withHeader('Debugbar-Link', site_url("?debugbar_time={$time}"));
Please login to merge, or discard this patch.
src/Debug/ExceptionManager.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public static function registerHttpErrors(Run $debugger, array $config): Run
37 37
     {
38
-        return $debugger->pushHandler(static function (Throwable $exception, InspectorInterface $inspector, RunInterface $run) use ($config) {
38
+        return $debugger->pushHandler(static function(Throwable $exception, InspectorInterface $inspector, RunInterface $run) use ($config) {
39 39
             if (true === $config['log']) {
40
-                if (! in_array($exception->getCode(), $config['ignore_codes'], true)) {
40
+                if (!in_array($exception->getCode(), $config['ignore_codes'], true)) {
41 41
                     Services::logger()->error($exception);
42 42
                 }
43 43
             }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             $debugger->pushHandler(new PlainTextHandler());
87 87
         }
88 88
 
89
-        if (! is_online()) {
89
+        if (!is_online()) {
90 90
             if (Misc::isAjaxRequest()) {
91 91
                 $debugger->pushHandler(new JsonResponseHandler());
92 92
             } else {
Please login to merge, or discard this patch.
src/Debug/Toolbar/Collectors/ViewsCollector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
     public function getVarData(): array
95 95
     {
96 96
         return [
97
-            'Données de la vues' => array_filter($this->viewer->getData(), static fn ($data) => ! ($data instanceof ErrorBag)),
97
+            'Données de la vues' => array_filter($this->viewer->getData(), static fn ($data) => !($data instanceof ErrorBag)),
98 98
         ];
99 99
     }
100 100
 
Please login to merge, or discard this patch.
src/Http/Response.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
         $this->_streamMode   = $options['streamMode'] ?? $this->_streamMode;
453 453
 
454 454
         if (isset($options['stream'])) {
455
-            if (! $options['stream'] instanceof StreamInterface) {
455
+            if (!$options['stream'] instanceof StreamInterface) {
456 456
                 throw new InvalidArgumentException('Stream option must be an object that implements StreamInterface');
457 457
             }
458 458
             $this->stream = $options['stream'];
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
             $this->_setStatus($options['status']);
469 469
         }
470 470
 
471
-        if (! isset($options['charset'])) {
471
+        if (!isset($options['charset'])) {
472 472
             $options['charset'] = config('app.charset');
473 473
         }
474 474
         $this->_charset = $options['charset'];
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
             $charset = true;
517 517
         }
518 518
 
519
-        if ($charset && ! str_contains($type, ';')) {
519
+        if ($charset && !str_contains($type, ';')) {
520 520
             $this->_setHeader('Content-Type', "{$type}; charset={$this->_charset}");
521 521
         } else {
522 522
             $this->_setHeader('Content-Type', $type);
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
     protected function _clearHeader(string $header): void
597 597
     {
598 598
         $normalized = strtolower($header);
599
-        if (! isset($this->headerNames[$normalized])) {
599
+        if (!isset($this->headerNames[$normalized])) {
600 600
             return;
601 601
         }
602 602
         $original = $this->headerNames[$normalized];
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
         if ($mapped) {
753 753
             return is_array($mapped) ? current($mapped) : $mapped;
754 754
         }
755
-        if (! str_contains($contentType, '/')) {
755
+        if (!str_contains($contentType, '/')) {
756 756
             throw new InvalidArgumentException(sprintf('"%s" is an invalid content type.', $contentType));
757 757
         }
758 758
 
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
      */
836 836
     public function withCache($since, $time = '+1 day'): static
837 837
     {
838
-        if (! is_int($time)) {
838
+        if (!is_int($time)) {
839 839
             $time = strtotime($time);
840 840
             if ($time === false) {
841 841
                 throw new InvalidArgumentException(
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
      */
1290 1290
     public function getCookie(string $name): ?array
1291 1291
     {
1292
-        if (! $this->_cookies->has($name)) {
1292
+        if (!$this->_cookies->has($name)) {
1293 1293
             return null;
1294 1294
         }
1295 1295
 
@@ -1362,7 +1362,7 @@  discard block
 block discarded – undo
1362 1362
 
1363 1363
         $extension = strtolower($file->getExtension());
1364 1364
         $mapped    = $this->getMimeType($extension);
1365
-        if ((! $extension || ! $mapped) && $options['download'] === null) {
1365
+        if ((!$extension || !$mapped) && $options['download'] === null) {
1366 1366
             $options['download'] = true;
1367 1367
         }
1368 1368
 
@@ -1424,12 +1424,12 @@  discard block
 block discarded – undo
1424 1424
         if (str_contains($path, '../') || str_contains($path, '..\\')) {
1425 1425
             throw new LoadException('The requested file contains `..` and will not be read.');
1426 1426
         }
1427
-        if (! is_file($path)) {
1427
+        if (!is_file($path)) {
1428 1428
             $path = APP_PATH . $path;
1429 1429
         }
1430 1430
 
1431 1431
         $file = new SplFileInfo($path);
1432
-        if (! $file->isFile() || ! $file->isReadable()) {
1432
+        if (!$file->isFile() || !$file->isReadable()) {
1433 1433
             if (on_dev()) {
1434 1434
                 throw new LoadException(sprintf('The requested file %s was not found or not readable', $path));
1435 1435
             }
Please login to merge, or discard this patch.
src/Http/ServerRequest.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
         $this->cookies = $config['cookies'];
235 235
 
236 236
         if (isset($config['uri'])) {
237
-            if (! $config['uri'] instanceof UriInterface) {
237
+            if (!$config['uri'] instanceof UriInterface) {
238 238
                 throw new FrameworkException('The `uri` key must be an instance of ' . UriInterface::class);
239 239
             }
240 240
             $uri = $config['uri'];
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
         }
438 438
 
439 439
         $type = strtolower($type);
440
-        if (! isset(static::$_detectors[$type])) {
440
+        if (!isset(static::$_detectors[$type])) {
441 441
             return false;
442 442
         }
443 443
         if ($args) {
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
     public function isAll(array $types): bool
590 590
     {
591 591
         foreach ($types as $type) {
592
-            if (! $this->is($type)) {
592
+            if (!$this->is($type)) {
593 593
                 return false;
594 594
             }
595 595
         }
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
     protected function normalizeHeaderName(string $name): string
694 694
     {
695 695
         $name = str_replace('-', '_', strtoupper($name));
696
-        if (! in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) {
696
+        if (!in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) {
697 697
             $name = 'HTTP_' . $name;
698 698
         }
699 699
 
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
     {
872 872
         $new = clone $this;
873 873
 
874
-        if (! preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)) {
874
+        if (!preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)) {
875 875
             throw new InvalidArgumentException(sprintf(
876 876
                 'Méthode HTTP non prise en charge "%s" fournie',
877 877
                 $method
@@ -1114,7 +1114,7 @@  discard block
 block discarded – undo
1114 1114
                 }
1115 1115
             }
1116 1116
 
1117
-            if (! isset($accept[$prefValue])) {
1117
+            if (!isset($accept[$prefValue])) {
1118 1118
                 $accept[$prefValue] = [];
1119 1119
             }
1120 1120
             if ($prefValue) {
@@ -1192,7 +1192,7 @@  discard block
 block discarded – undo
1192 1192
         if ($name === null) {
1193 1193
             return $this->data;
1194 1194
         }
1195
-        if (! is_array($this->data)) {
1195
+        if (!is_array($this->data)) {
1196 1196
             return $default;
1197 1197
         }
1198 1198
 
@@ -1332,7 +1332,7 @@  discard block
 block discarded – undo
1332 1332
      */
1333 1333
     public function withProtocolVersion(string $version): static
1334 1334
     {
1335
-        if (! preg_match('/^(1\.[01]|2(\.[0])?)$/', $version)) {
1335
+        if (!preg_match('/^(1\.[01]|2(\.[0])?)$/', $version)) {
1336 1336
             throw new InvalidArgumentException(sprintf('Version de protocole `%s` non prise en charge fournie.', $version));
1337 1337
         }
1338 1338
         $new           = clone $this;
@@ -1354,7 +1354,7 @@  discard block
 block discarded – undo
1354 1354
     public function getEnv(string $key, ?string $default = null): ?string
1355 1355
     {
1356 1356
         $key = strtoupper($key);
1357
-        if (! array_key_exists($key, $this->_environment)) {
1357
+        if (!array_key_exists($key, $this->_environment)) {
1358 1358
             $this->_environment[$key] = env($key);
1359 1359
         }
1360 1360
 
@@ -1571,7 +1571,7 @@  discard block
 block discarded – undo
1571 1571
         $file = Arr::get($this->uploadedFiles, $path);
1572 1572
         if (is_array($file)) {
1573 1573
             foreach ($file as $f) {
1574
-                if (! ($f instanceof UploadedFile)) {
1574
+                if (!($f instanceof UploadedFile)) {
1575 1575
                     return null;
1576 1576
                 }
1577 1577
             }
@@ -1579,7 +1579,7 @@  discard block
 block discarded – undo
1579 1579
             return $file;
1580 1580
         }
1581 1581
 
1582
-        if (! ($file instanceof UploadedFileInterface)) {
1582
+        if (!($file instanceof UploadedFileInterface)) {
1583 1583
             return null;
1584 1584
         }
1585 1585
 
@@ -1627,7 +1627,7 @@  discard block
 block discarded – undo
1627 1627
                 continue;
1628 1628
             }
1629 1629
 
1630
-            if (! $file instanceof UploadedFileInterface) {
1630
+            if (!$file instanceof UploadedFileInterface) {
1631 1631
                 throw new InvalidArgumentException("Fichier invalide à '{$path}{$key}'");
1632 1632
             }
1633 1633
         }
@@ -1678,7 +1678,7 @@  discard block
 block discarded – undo
1678 1678
         }
1679 1679
 
1680 1680
         $host = $uri->getHost();
1681
-        if (! $host) {
1681
+        if (!$host) {
1682 1682
             return $new;
1683 1683
         }
1684 1684
         $port = $uri->getPort();
@@ -1786,7 +1786,7 @@  discard block
 block discarded – undo
1786 1786
         $validLocales = config('app.supported_locales');
1787 1787
         // S'il ne s'agit pas d'un paramètre régional valide, définissez-le
1788 1788
         // aux paramètres régionaux par défaut du site.
1789
-        if (! in_array($locale, $validLocales, true)) {
1789
+        if (!in_array($locale, $validLocales, true)) {
1790 1790
             $locale = config('app.language');
1791 1791
         }
1792 1792
 
@@ -1886,7 +1886,7 @@  discard block
 block discarded – undo
1886 1886
             $override = true;
1887 1887
         }
1888 1888
 
1889
-        if ($override && ! in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'], true)) {
1889
+        if ($override && !in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'], true)) {
1890 1890
             $data = [];
1891 1891
         }
1892 1892
 
@@ -1936,7 +1936,7 @@  discard block
 block discarded – undo
1936 1936
      */
1937 1937
     protected function _processFiles(array $post, array $files): array
1938 1938
     {
1939
-        if (! is_array($files)) {
1939
+        if (!is_array($files)) {
1940 1940
             return $post;
1941 1941
         }
1942 1942
 
Please login to merge, or discard this patch.
src/View/Parser.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
         $file = $this->viewPath . $view;
96 96
 
97
-        if (! is_file($file)) {
97
+        if (!is_file($file)) {
98 98
             $fileOrig = $file;
99 99
             $file     = Services::locator()->locateFile($view, 'Views');
100 100
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
      */
167 167
     public function setData(array $data = [], ?string $context = null): self
168 168
     {
169
-        if (! empty($context)) {
169
+        if (!empty($context)) {
170 170
             foreach ($data as $key => &$value) {
171 171
                 if (is_array($value)) {
172 172
                     foreach ($value as &$obj) {
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
         foreach ($matches as $match) {
275 275
             // Loop over each piece of $data, replacing
276 276
             // its contents so that we know what to replace in parse()
277
-            $str = '';  // holds the new contents for this tag pair.
277
+            $str = ''; // holds the new contents for this tag pair.
278 278
 
279 279
             foreach ($data as $row) {
280 280
                 // Objects that have a `toArray()` method should be
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
                     if (is_array($val)) {
297 297
                         $pair = $this->parsePair($key, $val, $match[1]);
298 298
 
299
-                        if (! empty($pair)) {
299
+                        if (!empty($pair)) {
300 300
                             $pairs[array_keys($pair)[0]] = true;
301 301
 
302 302
                             $temp = array_merge($temp, $pair);
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 
317 317
                 // Now replace our placeholders with the new content.
318 318
                 foreach ($temp as $pattern => $content) {
319
-                    $out = $this->replaceSingle($pattern, $content, $out, ! isset($pairs[$pattern]));
319
+                    $out = $this->replaceSingle($pattern, $content, $out, !isset($pairs[$pattern]));
320 320
                 }
321 321
 
322 322
                 $str .= $out;
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
         $content = (string) $content;
487 487
 
488 488
         // Replace the content in the template
489
-        return preg_replace_callback($pattern, function ($matches) use ($content, $escape) {
489
+        return preg_replace_callback($pattern, function($matches) use ($content, $escape) {
490 490
             // Check for {! !} syntax to not escape this one.
491 491
             if (str_starts_with($matches[0], '{!') && substr($matches[0], -2) === '!}') {
492 492
                 $escape = false;
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 
506 506
         // Our regex earlier will leave all chained values on a single line
507 507
         // so we need to break them apart so we can apply them all.
508
-        $filters = ! empty($matches[1]) ? explode('|', $matches[1]) : [];
508
+        $filters = !empty($matches[1]) ? explode('|', $matches[1]) : [];
509 509
 
510 510
         if ($escape && empty($filters) && ($context = $this->shouldAddEscaping($orig))) {
511 511
             $filters[] = "esc({$context})";
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
             }
534 534
         }
535 535
         // No pipes, then we know we need to escape
536
-        elseif (! str_contains($key, '|')) {
536
+        elseif (!str_contains($key, '|')) {
537 537
             $escape = 'html';
538 538
         }
539 539
         // If there's a `noescape` then we're definitely false.
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
             $escape = false;
542 542
         }
543 543
         // If no `esc` filter is found, then we'll need to add one.
544
-        elseif (! preg_match('/\s+esc/', $key)) {
544
+        elseif (!preg_match('/\s+esc/', $key)) {
545 545
             $escape = 'html';
546 546
         }
547 547
 
@@ -560,10 +560,10 @@  discard block
 block discarded – undo
560 560
             preg_match('/\([\w<>=\/\\\,:.\-\s\+]+\)/', $filter, $param);
561 561
 
562 562
             // Remove the () and spaces to we have just the parameter left
563
-            $param = ! empty($param) ? trim($param[0], '() ') : null;
563
+            $param = !empty($param) ? trim($param[0], '() ') : null;
564 564
 
565 565
             // Params can be separated by commas to allow multiple parameters for the filter
566
-            if (! empty($param)) {
566
+            if (!empty($param)) {
567 567
                 $param = explode(',', $param);
568 568
 
569 569
                 // Clean it up
@@ -575,10 +575,10 @@  discard block
 block discarded – undo
575 575
             }
576 576
 
577 577
             // Get our filter name
578
-            $filter = ! empty($param) ? trim(strtolower(substr($filter, 0, strpos($filter, '(')))) : trim($filter);
578
+            $filter = !empty($param) ? trim(strtolower(substr($filter, 0, strpos($filter, '(')))) : trim($filter);
579 579
 
580 580
             $this->config['filters'] ??= [];
581
-            if (! array_key_exists($filter, $this->config['filters'])) {
581
+            if (!array_key_exists($filter, $this->config['filters'])) {
582 582
                 continue;
583 583
             }
584 584
 
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
              *   $matches[1] = all parameters string in opening tag
618 618
              *   $matches[2] = content between the tags to send to the plugin.
619 619
              */
620
-            if (! preg_match_all($pattern, $template, $matches, PREG_SET_ORDER)) {
620
+            if (!preg_match_all($pattern, $template, $matches, PREG_SET_ORDER)) {
621 621
                 continue;
622 622
             }
623 623
 
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
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
         $this->adapter->addData($data, $context);
158 158
 
159
-        if (! array_key_exists('errors', $this->getData())) {
159
+        if (!array_key_exists('errors', $this->getData())) {
160 160
             $this->setValidationErrors();
161 161
         }
162 162
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 
201 201
         $this->adapter->setData($data, $context);
202 202
 
203
-        if (! array_key_exists('errors', $this->getData())) {
203
+        if (!array_key_exists('errors', $this->getData())) {
204 204
             $this->setValidationErrors();
205 205
         }
206 206
 
@@ -240,10 +240,10 @@  discard block
 block discarded – undo
240 240
      */
241 241
     public function setAdapter(string $adapter, array $config = []): self
242 242
     {
243
-        if (! array_key_exists($adapter, self::$validAdapters)) {
243
+        if (!array_key_exists($adapter, self::$validAdapters)) {
244 244
             $adapter = 'native';
245 245
         }
246
-        if (empty($this->config['adapters']) || ! is_array($this->config['adapters'])) {
246
+        if (empty($this->config['adapters']) || !is_array($this->config['adapters'])) {
247 247
             $this->config['adapters'] = [];
248 248
         }
249 249
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
     protected function decorate(string $output): string
301 301
     {
302 302
         foreach ($this->config['decorators'] as $decorator) {
303
-            if (! is_subclass_of($decorator, ViewDecoratorInterface::class)) {
303
+            if (!is_subclass_of($decorator, ViewDecoratorInterface::class)) {
304 304
                 throw ViewException::invalidDecorator($decorator);
305 305
             }
306 306
 
Please login to merge, or discard this patch.
src/Helpers/common.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 // ================================= FONCTIONS UTIILITAIRES ESSENTIELLES ================================= //
26 26
 
27
-if (! function_exists('env')) {
27
+if (!function_exists('env')) {
28 28
     /**
29 29
      * Obtient une variable d'environnement à partir des sources disponibles et fournit une émulation
30 30
      * pour les variables d'environnement non prises en charge ou incohérentes
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     }
41 41
 }
42 42
 
43
-if (! function_exists('helper')) {
43
+if (!function_exists('helper')) {
44 44
     /**
45 45
      * Charge un fichier d'aide en mémoire. Prend en charge les assistants d'espace de noms,
46 46
      * à la fois dans et hors du répertoire 'helpers' d'un répertoire à espace de noms.
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     }
57 57
 }
58 58
 
59
-if (! function_exists('model')) {
59
+if (!function_exists('model')) {
60 60
     /**
61 61
      * Simple maniere d'obtenir un modele.
62 62
      *
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
      *
67 67
      * @return T
68 68
      */
69
-    function model(array|string $name, ?ConnectionInterface &$conn = null)
69
+    function model(array|string $name, ?ConnectionInterface&$conn = null)
70 70
     {
71 71
         return Load::model($name, $conn);
72 72
     }
73 73
 }
74 74
 
75
-if (! function_exists('service')) {
75
+if (!function_exists('service')) {
76 76
     /**
77 77
      * Permet un accès plus propre au fichier de configuration des services.
78 78
      * Renvoie toujours une instance SHARED de la classe, donc
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     }
90 90
 }
91 91
 
92
-if (! function_exists('single_service')) {
92
+if (!function_exists('single_service')) {
93 93
     /**
94 94
      * Autoriser l'accès propre à un service.
95 95
      * Renvoie toujours une nouvelle instance de la classe.
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     }
104 104
 }
105 105
 
106
-if (! function_exists('show404')) {
106
+if (!function_exists('show404')) {
107 107
     /**
108 108
      * Afficher une page 404 introuvable dans le navigateur
109 109
      */
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     }
114 114
 }
115 115
 
116
-if (! function_exists('config')) {
116
+if (!function_exists('config')) {
117 117
     /**
118 118
      * GET/SET App config
119 119
      *
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     }
142 142
 }
143 143
 
144
-if (! function_exists('logger')) {
144
+if (!function_exists('logger')) {
145 145
     /**
146 146
      * Une méthode de commodité pour les événements de journalisation via le système Log.
147 147
      *
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     }
172 172
 }
173 173
 
174
-if (! function_exists('cache')) {
174
+if (!function_exists('cache')) {
175 175
     /**
176 176
      * Une méthode pratique qui donne accès au cache
177 177
      * objet. Si aucun paramètre n'est fourni, renverra l'objet,
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
     }
202 202
 }
203 203
 
204
-if (! function_exists('session')) {
204
+if (!function_exists('session')) {
205 205
     /**
206 206
      * Une méthode pratique pour accéder à l'instance de session, ou un élément qui a été défini dans la session.
207 207
      *
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
 // =========================== FONCTIONS DE PREVENTION D'ATTAQUE =========================== //
228 228
 
229
-if (! function_exists('esc')) {
229
+if (!function_exists('esc')) {
230 230
     /**
231 231
      * Effectue un simple échappement automatique des données pour des raisons de sécurité.
232 232
      * Pourrait envisager de rendre cela plus complexe à une date ultérieure.
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
     }
254 254
 }
255 255
 
256
-if (! function_exists('h')) {
256
+if (!function_exists('h')) {
257 257
     /**
258 258
      * Méthode pratique pour htmlspecialchars.
259 259
      *
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
     }
273 273
 }
274 274
 
275
-if (! function_exists('purify')) {
275
+if (!function_exists('purify')) {
276 276
     /**
277 277
      * Purifiez l'entrée à l'aide de la classe autonome HTMLPurifier.
278 278
      * Utilisez facilement plusieurs configurations de purificateur.
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
     }
289 289
 }
290 290
 
291
-if (! function_exists('remove_invisible_characters')) {
291
+if (!function_exists('remove_invisible_characters')) {
292 292
     /**
293 293
      * Supprimer les caractères invisibles
294 294
      *
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
     }
302 302
 }
303 303
 
304
-if (! function_exists('stringify_attributes')) {
304
+if (!function_exists('stringify_attributes')) {
305 305
     /**
306 306
      * Chaîner les attributs à utiliser dans les balises HTML.
307 307
      *
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 
316 316
 // ================================= FONCTIONS D'ENVIRONNEMENT D'EXECUTION ================================= //
317 317
 
318
-if (! function_exists('environment')) {
318
+if (!function_exists('environment')) {
319 319
     /**
320 320
      * Renvoi l'environnement d'execution actuel ou determine si on est dans un environnement specifie
321 321
      *
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
     }
354 354
 }
355 355
 
356
-if (! function_exists('on_dev')) {
356
+if (!function_exists('on_dev')) {
357 357
     /**
358 358
      * Testez pour voir si nous sommes dans un environnement de développement.
359 359
      */
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
     }
368 368
 }
369 369
 
370
-if (! function_exists('on_prod')) {
370
+if (!function_exists('on_prod')) {
371 371
     /**
372 372
      * Testez pour voir si nous sommes dans un environnement de production.
373 373
      */
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
     }
382 382
 }
383 383
 
384
-if (! function_exists('on_test')) {
384
+if (!function_exists('on_test')) {
385 385
     /**
386 386
      * Testez pour voir si nous sommes dans un environnement de test
387 387
      */
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
     }
392 392
 }
393 393
 
394
-if (! function_exists('is_cli')) {
394
+if (!function_exists('is_cli')) {
395 395
     /**
396 396
      * Testez pour voir si une demande a été faite à partir de la ligne de commande.
397 397
      */
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
     }
402 402
 }
403 403
 
404
-if (! function_exists('is_php')) {
404
+if (!function_exists('is_php')) {
405 405
     /**
406 406
      * Détermine si la version actuelle de PHP est égale ou supérieure à la valeur fournie.
407 407
      */
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
     }
412 412
 }
413 413
 
414
-if (! function_exists('is_windows')) {
414
+if (!function_exists('is_windows')) {
415 415
     /**
416 416
      * Déterminez si l'environnement actuel est basé sur Windows.
417 417
      */
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
     }
422 422
 }
423 423
 
424
-if (! function_exists('is_https')) {
424
+if (!function_exists('is_https')) {
425 425
     /**
426 426
      * Determines if the application is accessed via an encrypted * (HTTPS) connection.
427 427
      */
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
     }
432 432
 }
433 433
 
434
-if (! function_exists('is_localfile')) {
434
+if (!function_exists('is_localfile')) {
435 435
     /**
436 436
      * Vérifiez si le fichier auquel vous souhaitez accéder est un fichier local de votre application ou non
437 437
      */
@@ -441,11 +441,11 @@  discard block
 block discarded – undo
441 441
             return true;
442 442
         }
443 443
 
444
-        return ! preg_match('#^(https?://)#i', $name);
444
+        return !preg_match('#^(https?://)#i', $name);
445 445
     }
446 446
 }
447 447
 
448
-if (! function_exists('is_online')) {
448
+if (!function_exists('is_online')) {
449 449
     /**
450 450
      * Tester si l'application s'exécute en local ou en ligne.
451 451
      */
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
     }
456 456
 }
457 457
 
458
-if (! function_exists('is_connected')) {
458
+if (!function_exists('is_connected')) {
459 459
     /**
460 460
      * Verifie si l'utilisateur a une connexion internet active.
461 461
      */
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
     }
466 466
 }
467 467
 
468
-if (! function_exists('is_ajax_request')) {
468
+if (!function_exists('is_ajax_request')) {
469 469
     /**
470 470
      * Testez pour voir si une requête contient l'en-tête HTTP_X_REQUESTED_WITH.
471 471
      */
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
     }
476 476
 }
477 477
 
478
-if (! function_exists('redirection')) {
478
+if (!function_exists('redirection')) {
479 479
     /**
480 480
      * Redirige l'utilisateur
481 481
      */
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
     }
490 490
 }
491 491
 
492
-if (! function_exists('redirect')) {
492
+if (!function_exists('redirect')) {
493 493
     /**
494 494
      * Méthode pratique qui fonctionne avec la $request globale actuelle et
495 495
      * l'instance $router à rediriger à l'aide de routes nommées et le routage inversé
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
     {
504 504
         $redirection = Services::redirection();
505 505
 
506
-        if (! empty($uri)) {
506
+        if (!empty($uri)) {
507 507
             return $redirection->route($uri);
508 508
         }
509 509
 
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
     }
512 512
 }
513 513
 
514
-if (! function_exists('back')) {
514
+if (!function_exists('back')) {
515 515
     /**
516 516
      * Retourne a la page precedente
517 517
      *
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
     }
524 524
 }
525 525
 
526
-if (! function_exists('link_to')) {
526
+if (!function_exists('link_to')) {
527 527
     /**
528 528
      * Étant donné une chaîne de contrôleur/méthode et tous les paramètres,
529 529
      * tentera de créer l'URL relative à la route correspondante.
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
     }
544 544
 }
545 545
 
546
-if (! function_exists('clean_path')) {
546
+if (!function_exists('clean_path')) {
547 547
     /**
548 548
      * Une méthode pratique pour nettoyer les chemins pour
549 549
      * une sortie plus belle. Utile pour les exceptions
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
     }
576 576
 }
577 577
 
578
-if (! function_exists('old')) {
578
+if (!function_exists('old')) {
579 579
     /**
580 580
      * Fournit l'accès à "entrée ancienne" qui a été définie dans la session lors d'un redirect()-withInput().
581 581
      *
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
     function old(string $key, $default = null, $escape = 'html')
589 589
     {
590 590
         // Assurez-vous de charger la session
591
-        if (session_status() === PHP_SESSION_NONE && ! on_test()) {
591
+        if (session_status() === PHP_SESSION_NONE && !on_test()) {
592 592
             session(); // @codeCoverageIgnore
593 593
         }
594 594
 
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 
604 604
 // ================================= FONCTIONS DE DEBOGAGE ================================= //
605 605
 
606
-if (! function_exists('deprecationWarning')) {
606
+if (!function_exists('deprecationWarning')) {
607 607
     /**
608 608
      * Méthode d'assistance pour générer des avertissements d'obsolescence
609 609
      *
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
     }
620 620
 }
621 621
 
622
-if (! function_exists('pr')) {
622
+if (!function_exists('pr')) {
623 623
     /**
624 624
      * print_r() convenience function.
625 625
      *
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
     }
642 642
 }
643 643
 
644
-if (! function_exists('pj')) {
644
+if (!function_exists('pj')) {
645 645
     /**
646 646
      * json pretty print convenience function.
647 647
      *
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
     }
663 663
 }
664 664
 
665
-if (! function_exists('trigger_warning')) {
665
+if (!function_exists('trigger_warning')) {
666 666
     /**
667 667
      * Déclenche un E_USER_WARNING.
668 668
      */
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
 
675 675
 // ================================= FONCTIONS DIVERSES ================================= //
676 676
 
677
-if (! function_exists('force_https')) {
677
+if (!function_exists('force_https')) {
678 678
     /**
679 679
      * Utilisé pour forcer l'accès à une page via HTTPS.
680 680
      * Utilise une redirection standard, plus définira l'en-tête HSTS
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
     }
733 733
 }
734 734
 
735
-if (! function_exists('get_type_name')) {
735
+if (!function_exists('get_type_name')) {
736 736
     /**
737 737
      * Renvoie la classe d'objets ou le type var de ce n'est pas un objet
738 738
      *
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
     }
747 747
 }
748 748
 
749
-if (! function_exists('ip_address')) {
749
+if (!function_exists('ip_address')) {
750 750
     /**
751 751
      * Renvoie l'adresse IP de l'utilisateur actuel
752 752
      */
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
     }
757 757
 }
758 758
 
759
-if (! function_exists('is_really_writable')) {
759
+if (!function_exists('is_really_writable')) {
760 760
     /**
761 761
      * Tests d'inscriptibilité des fichiers
762 762
      */
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
     }
767 767
 }
768 768
 
769
-if (! function_exists('lang')) {
769
+if (!function_exists('lang')) {
770 770
     /**
771 771
      * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater
772 772
      * le résultat avec le MessageFormatter de l'extension intl.
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
     }
778 778
 }
779 779
 
780
-if (! function_exists('__')) {
780
+if (!function_exists('__')) {
781 781
     /**
782 782
      * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater
783 783
      * le résultat avec le MessageFormatter de l'extension intl.
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
     }
791 791
 }
792 792
 
793
-if (! function_exists('namespace_split')) {
793
+if (!function_exists('namespace_split')) {
794 794
     /**
795 795
      * Séparez l'espace de noms du nom de classe.
796 796
      *
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
     }
812 812
 }
813 813
 
814
-if (! function_exists('view_exist')) {
814
+if (!function_exists('view_exist')) {
815 815
     /**
816 816
      * Verifie si un fichier de vue existe. Utile pour limiter les failles include
817 817
      */
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
     }
826 826
 }
827 827
 
828
-if (! function_exists('view')) {
828
+if (!function_exists('view')) {
829 829
     /**
830 830
      * Charge une vue
831 831
      *
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
     }
842 842
 }
843 843
 
844
-if (! function_exists('flash')) {
844
+if (!function_exists('flash')) {
845 845
     /**
846 846
      * Fournisseur d'acces rapide a la classe PHP Flash
847 847
      *
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
     }*/
874 874
 }
875 875
 
876
-if (! function_exists('geo_ip')) {
876
+if (!function_exists('geo_ip')) {
877 877
     /**
878 878
      * Recuperation des coordonnees (pays, ville, etc) d'un utilisateur en fonction de son ip
879 879
      */
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
     }
884 884
 }
885 885
 
886
-if (! function_exists('to_stream')) {
886
+if (!function_exists('to_stream')) {
887 887
     /**
888 888
      * Créez un nouveau flux basé sur le type d'entrée.
889 889
      *
@@ -904,7 +904,7 @@  discard block
 block discarded – undo
904 904
     }
905 905
 }
906 906
 
907
-if (! function_exists('value')) {
907
+if (!function_exists('value')) {
908 908
     /**
909 909
      * Renvoie la valeur par défaut de la valeur donnée.
910 910
      */
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
     }
915 915
 }
916 916
 
917
-if (! function_exists('collect')) {
917
+if (!function_exists('collect')) {
918 918
     /**
919 919
      * Créez une collection à partir de la valeur donnée.
920 920
      */
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
     }
925 925
 }
926 926
 
927
-if (! function_exists('with')) {
927
+if (!function_exists('with')) {
928 928
     /**
929 929
      * Renvoie la valeur donnée, éventuellement transmise via le rappel donné.
930 930
      *
@@ -936,7 +936,7 @@  discard block
 block discarded – undo
936 936
     }
937 937
 }
938 938
 
939
-if (! function_exists('tap')) {
939
+if (!function_exists('tap')) {
940 940
     /**
941 941
      * Appelez la Closure donnée avec cette instance puis renvoyez l'instance.
942 942
      */
@@ -946,7 +946,7 @@  discard block
 block discarded – undo
946 946
     }
947 947
 }
948 948
 
949
-if (! function_exists('last')) {
949
+if (!function_exists('last')) {
950 950
     /**
951 951
      * Recupere le dernier element d'un tableau
952 952
      */
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
     }
957 957
 }
958 958
 
959
-if (! function_exists('invade')) {
959
+if (!function_exists('invade')) {
960 960
     /**
961 961
      * Cette classe offre une fonction d'invasion qui vous permettra de lire / écrire des propriétés privées d'un objet.
962 962
      * Il vous permettra également de définir, obtenir et appeler des méthodes privées.
Please login to merge, or discard this patch.