Passed
Push — main ( c0dba5...15ce1f )
by Dimitri
03:26
created
src/Mail/Mailable.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
     public function send(Mail $mail): bool
174 174
     {
175 175
         foreach ($this->bcc() as $key => $value) {
176
-            if (empty($value) || ! is_string($value)) {
176
+            if (empty($value) || !is_string($value)) {
177 177
                 continue;
178 178
             }
179 179
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         }
186 186
 
187 187
         foreach ($this->cc() as $key => $value) {
188
-            if (empty($value) || ! is_string($value)) {
188
+            if (empty($value) || !is_string($value)) {
189 189
                 continue;
190 190
             }
191 191
 
@@ -198,12 +198,12 @@  discard block
 block discarded – undo
198 198
 
199 199
         $content = $this->content();
200 200
 
201
-        if (! empty($content['view'])) {
201
+        if (!empty($content['view'])) {
202 202
             $mail->view($content['view'], $this->data());
203
-        } elseif (! empty($content['html'])) {
203
+        } elseif (!empty($content['html'])) {
204 204
             $mail->html($content['html']);
205 205
         }
206
-        if (! empty($content['text'])) {
206
+        if (!empty($content['text'])) {
207 207
             $mail->text($content['text']);
208 208
         }
209 209
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
         $mail->priority($this->priority());
213 213
 
214 214
         foreach ($this->replyTo() as $key => $value) {
215
-            if (empty($value) || ! is_string($value)) {
215
+            if (empty($value) || !is_string($value)) {
216 216
                 continue;
217 217
             }
218 218
 
Please login to merge, or discard this patch.
src/Loader/Load.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             return $models;
74 74
         }
75 75
 
76
-        if (! self::isLoaded('models', $model)) {
76
+        if (!self::isLoaded('models', $model)) {
77 77
             self::loaded('models', $model, FileLocator::model($model, $connection));
78 78
         }
79 79
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      */
88 88
     private static function isLoaded(string $module, $element): bool
89 89
     {
90
-        if (! isset(self::$loads[$module]) || ! is_array(self::$loads[$module])) {
90
+        if (!isset(self::$loads[$module]) || !is_array(self::$loads[$module])) {
91 91
             return false;
92 92
         }
93 93
 
Please login to merge, or discard this patch.
src/Helpers/url.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 // =================================  ================================= //
26 26
 
27
-if (! function_exists('site_url')) {
27
+if (!function_exists('site_url')) {
28 28
     /**
29 29
      * Renvoie une URL de site telle que définie par la configuration de l'application.
30 30
      *
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     }
49 49
 }
50 50
 
51
-if (! function_exists('base_url')) {
51
+if (!function_exists('base_url')) {
52 52
     /**
53 53
      * Renvoie l'URL de base telle que définie par la configuration de l'application.
54 54
      * Les URL de base sont des URL de site coupées sans la page d'index.
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     }
68 68
 }
69 69
 
70
-if (! function_exists('current_url')) {
70
+if (!function_exists('current_url')) {
71 71
     /**
72 72
      * Renvoie l'URL complète (y compris les segments) de la page où cette fonction est placée
73 73
      *
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     }
95 95
 }
96 96
 
97
-if (! function_exists('previous_url')) {
97
+if (!function_exists('previous_url')) {
98 98
     /**
99 99
      * Renvoie l'URL précédente sur laquelle se trouvait le visiteur actuel. Pour des raisons de sécurité
100 100
      * nous vérifions d'abord une variable de session enregistrée, si elle existe, et l'utilisons.
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     }
120 120
 }
121 121
 
122
-if (! function_exists('uri_string')) {
122
+if (!function_exists('uri_string')) {
123 123
     /**
124 124
      * Renvoie la partie chemin de l'URL actuelle
125 125
      *
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     }
134 134
 }
135 135
 
136
-if (! function_exists('index_page')) {
136
+if (!function_exists('index_page')) {
137 137
     /**
138 138
      * Renvoie la "index_page" de votre fichier de configuration
139 139
      */
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
     }
144 144
 }
145 145
 
146
-if (! function_exists('anchor')) {
146
+if (!function_exists('anchor')) {
147 147
     /**
148 148
      * Crée une ancre basée sur l'URL locale.
149 149
      *
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     }
169 169
 }
170 170
 
171
-if (! function_exists('anchor_popup')) {
171
+if (!function_exists('anchor_popup')) {
172 172
     /**
173 173
      * Lien d'ancrage - Version contextuelle
174 174
      *
@@ -191,12 +191,12 @@  discard block
 block discarded – undo
191 191
             return '<a href="' . $siteUrl . '" onclick="window.open(\'' . $siteUrl . "', '_blank'); return false;\">" . $title . '</a>';
192 192
         }
193 193
 
194
-        if (! is_array($attributes)) {
194
+        if (!is_array($attributes)) {
195 195
             $attributes = [$attributes];
196 196
 
197 197
             // Ref: http://www.w3schools.com/jsref/met_win_open.asp
198 198
             $windowName = '_blank';
199
-        } elseif (! empty($attributes['window_name'])) {
199
+        } elseif (!empty($attributes['window_name'])) {
200 200
             $windowName = $attributes['window_name'];
201 201
             unset($attributes['window_name']);
202 202
         } else {
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     }
217 217
 }
218 218
 
219
-if (! function_exists('mailto')) {
219
+if (!function_exists('mailto')) {
220 220
     /**
221 221
      * Lien Mailto
222 222
      *
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     }
234 234
 }
235 235
 
236
-if (! function_exists('safe_mailto')) {
236
+if (!function_exists('safe_mailto')) {
237 237
     /**
238 238
      * Lien Mailto codé
239 239
      *
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
     }
323 323
 }
324 324
 
325
-if (! function_exists('auto_link')) {
325
+if (!function_exists('auto_link')) {
326 326
     /**
327 327
      * Lien automatique
328 328
      *
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
     function auto_link(string $str, string $type = 'both', bool $popup = false): string
338 338
     {
339 339
         // Recherche et remplace tous les URLs.
340
-        if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[^\s()<>;]+\w#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {
340
+        if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[^\s()<>;]+\w#i', $str, $matches, PREG_OFFSET_CAPTURE|PREG_SET_ORDER)) {
341 341
             // Définissez notre HTML cible si vous utilisez des liens contextuels.
342 342
             $target = ($popup) ? ' target="_blank"' : '';
343 343
 
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
     }
369 369
 }
370 370
 
371
-if (! function_exists('prep_url')) {
371
+if (!function_exists('prep_url')) {
372 372
     /**
373 373
      * Ajoute simplement la partie http:// ou https:// si aucun schéma n'est inclus.
374 374
      *
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
     }
394 394
 }
395 395
 
396
-if (! function_exists('url_title')) {
396
+if (!function_exists('url_title')) {
397 397
     /**
398 398
      * Créer un titre d'URL
399 399
      *
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
     }
430 430
 }
431 431
 
432
-if (! function_exists('mb_url_title')) {
432
+if (!function_exists('mb_url_title')) {
433 433
     /**
434 434
      * Créer un titre d'URL qui prend en compte les caractères accentués
435 435
      *
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
     }
449 449
 }
450 450
 
451
-if (! function_exists('url_to')) {
451
+if (!function_exists('url_to')) {
452 452
     /**
453 453
      * Obtenir l'URL complète et absolue d'une méthode de contrôleur
454 454
      * (avec arguments supplémentaires)
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
      */
462 462
     function url_to(string $controller, ...$args): string
463 463
     {
464
-        if (! $route = link_to($controller, ...$args)) {
464
+        if (!$route = link_to($controller, ...$args)) {
465 465
             $explode = explode('::', $controller);
466 466
 
467 467
             if (isset($explode[1])) {
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
     }
476 476
 }
477 477
 
478
-if (! function_exists('url_is')) {
478
+if (!function_exists('url_is')) {
479 479
     /**
480 480
      * Détermine si le chemin d'URL actuel contient le chemin donné.
481 481
      * Il peut contenir un caractère générique (*) qui autorisera tout caractère valide.
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
     }
494 494
 }
495 495
 
496
-if (! function_exists('link_active')) {
496
+if (!function_exists('link_active')) {
497 497
     /**
498 498
      * Lien actif dans la navbar
499 499
      * Un peut comme le router-active-link de vuejs
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
             return $active_class;
509 509
         }
510 510
         
511
-        if (! $exact && preg_match('#^' . $path . '/?#i', $current_section)) {
511
+        if (!$exact && preg_match('#^' . $path . '/?#i', $current_section)) {
512 512
             return $active_class;
513 513
         }
514 514
         
@@ -520,14 +520,14 @@  discard block
 block discarded – undo
520 520
     }
521 521
 }
522 522
 
523
-if (! function_exists('clean_url')) {
523
+if (!function_exists('clean_url')) {
524 524
     function clean_url(string $url): string
525 525
     {
526 526
         return Helpers::cleanUrl($url);
527 527
     }
528 528
 }
529 529
 
530
-if (! function_exists('is_absolute_link')) {
530
+if (!function_exists('is_absolute_link')) {
531 531
     /**
532 532
      * Verifies si un chemin donnée est une url absolue ou relative
533 533
      */
Please login to merge, or discard this patch.
src/Helpers/scl.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
 function scl_upLoad($input, $path = '', $size = 2500000, $type = '', $output = '')
28 28
 {
29 29
     // taille par défaut
30
-    $size = (empty($size) || ! is_numeric($size)) ? 2500000 : $size;
30
+    $size = (empty($size) || !is_numeric($size)) ? 2500000 : $size;
31 31
     // Le dossier par defaut est la racine
32
-    $path = (! empty($path) && ! file_exists($path)) ? '' : htmlspecialchars($path);
32
+    $path = (!empty($path) && !file_exists($path)) ? '' : htmlspecialchars($path);
33 33
 
34
-    if (! is_array($input)) {
34
+    if (!is_array($input)) {
35 35
         return [0, 'Entrée non valide'];
36 36
     }
37 37
     if (empty($input['tmp_name']) || empty($input['name']) || empty($input['size'])) {
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         }
110 110
     }
111 111
 
112
-    if (! in_array(strtolower(pathinfo($input['name'])['extension']), $extensions, true)) {
112
+    if (!in_array(strtolower(pathinfo($input['name'])['extension']), $extensions, true)) {
113 113
         return [3, 'Extension non prise en charge'];
114 114
     }
115 115
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $output    = 'scl_' . date('Ymd') . '-' . date('His');
126 126
         $extension = '0.';
127 127
     } else { // Si on defini le nom de sortie...
128
-        if (! empty(explode('.', $output)[1]) && in_array(strtolower(explode('.', $output)[1]), $extensions, true)) {  // Si l'extension est presente dans ce nom et est valide...
128
+        if (!empty(explode('.', $output)[1]) && in_array(strtolower(explode('.', $output)[1]), $extensions, true)) {  // Si l'extension est presente dans ce nom et est valide...
129 129
             $out       = explode('.', $output);
130 130
             $output    = $out[0]; // On enregistre le fichier avec le nom specifié
131 131
             $extension = '1.' . $out[1]; // On enregistre le fichier avec l'extension specifié (changement d'extension)
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     }
145 145
 
146 146
     // si le fichier n'a pas été téléchargé
147
-    if (! move_uploaded_file($input['tmp_name'], $path . $output . '.' . $extension)) {
147
+    if (!move_uploaded_file($input['tmp_name'], $path . $output . '.' . $extension)) {
148 148
         return [4, 'Erreur de téléversement'];
149 149
     }
150 150
 
@@ -165,11 +165,11 @@  discard block
 block discarded – undo
165 165
 function scl_minimizeImg($src, $size = [], $relative = false)
166 166
 {
167 167
     // Si le fichier n'existe pas
168
-    if (! file_exists($src)) {
168
+    if (!file_exists($src)) {
169 169
         return [0, 'Fichier inexistant'];
170 170
     }
171 171
     // Si on n'envoi pas un tableau ou un nombre comme tailles
172
-    if (empty($size) || (! is_array($size) && ! is_int($size))) {
172
+    if (empty($size) || (!is_array($size) && !is_int($size))) {
173 173
         return [1, 'Mauvaises dimensions de redimensionnement'];
174 174
     }
175 175
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             return [2, 'Violation du nombre de dimension'];
181 181
         }
182 182
         // Si l'un des element du tableau n'est pas un nombre
183
-        if (! is_int($size[0]) || (! empty($size[1]) && ! is_int($size[1]))) {
183
+        if (!is_int($size[0]) || (!empty($size[1]) && !is_int($size[1]))) {
184 184
             return [3, 'Type de dimension inconnu'];
185 185
         }
186 186
     }
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 {
259 259
     // Valeurs par défaut
260 260
     $nbr = (empty($nbr)) ? 8 : (int) $nbr;
261
-    $nbr = (! is_int($nbr)) ? 8 : (int) $nbr;
261
+    $nbr = (!is_int($nbr)) ? 8 : (int) $nbr;
262 262
     $nbr = ($nbr < 3 || $nbr > 64) ? 8 : (int) $nbr;
263 263
 
264 264
     switch ($type) {
@@ -316,12 +316,12 @@  discard block
 block discarded – undo
316 316
 function scl_date($date, $format = 'D, d M Y', $interval = true, $fuseau = 'Europe/Paris')
317 317
 {
318 318
     // Valeurs par défaut
319
-    $format   = (empty($format) || ! is_string($format)) ? 'D, d M Y' : htmlspecialchars(trim($format)); // Le format de sortie, par défaut = D, d M Y
320
-    $fuseau   = (empty($fuseau) || ! is_string($fuseau)) ? 'Europe/Paris' : htmlspecialchars(trim($fuseau)); // fuseau horaire
321
-    $interval = (! is_bool($interval)) ? true : $interval; // Specifie si on gere les intervales ou pas
319
+    $format   = (empty($format) || !is_string($format)) ? 'D, d M Y' : htmlspecialchars(trim($format)); // Le format de sortie, par défaut = D, d M Y
320
+    $fuseau   = (empty($fuseau) || !is_string($fuseau)) ? 'Europe/Paris' : htmlspecialchars(trim($fuseau)); // fuseau horaire
321
+    $interval = (!is_bool($interval)) ? true : $interval; // Specifie si on gere les intervales ou pas
322 322
     $interval = ($interval === false) ? false : true; // Specifie si on gere les intervales ou pas
323 323
 
324
-    $date = new DateTime($date);  // On contruit la date
324
+    $date = new DateTime($date); // On contruit la date
325 325
 
326 326
     // Si on ne gere pas les intervales
327 327
     if ($interval === false) {
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
 function scl_hash($str, $lenght = 128, $key = '')
494 494
 {
495 495
     // Valeur par defaut
496
-    $lenght = (empty($lenght) || ! is_int($lenght)) ? 128 : $lenght;
496
+    $lenght = (empty($lenght) || !is_int($lenght)) ? 128 : $lenght;
497 497
     //    Valeurs minimale et maximale pour le haché
498 498
     $lenght = ($lenght < 50) ? 50 : $lenght;
499 499
     $lenght = ($lenght > 200) ? 200 : $lenght;
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
     // Valeur par defaut
541 541
     $action = strtolower($action);
542 542
     $action = ($action !== 'decrypt') ? 'encrypt' : 'decrypt';
543
-    $repeat = (! is_int($repeat) || $repeat < 1) ? 0 : $repeat;
543
+    $repeat = (!is_int($repeat) || $repeat < 1) ? 0 : $repeat;
544 544
 
545 545
     $chars = ''; // Les differents caractères entrés
546 546
     $size  = strlen($str);
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
         'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
568 568
         'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
569 569
     ];
570
-    $chars  = explode(' ', $chars);  // On transforme la chaine précédement créée en tableau
570
+    $chars  = explode(' ', $chars); // On transforme la chaine précédement créée en tableau
571 571
     $return = '';
572 572
 
573 573
     // On parcours tout le dit tableau (ie. on recupere les caracteres un a un)
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
 {
666 666
     // Valeur par defaut
667 667
     $str  = htmlspecialchars($str); // On protege la chaine
668
-    $size = (! is_numeric($size)) ? strlen($str) : $size; // Taille à couper
668
+    $size = (!is_numeric($size)) ? strlen($str) : $size; // Taille à couper
669 669
 
670 670
     $lenght = strlen($str); // longueur de la chaine
671 671
     if ($lenght > $size) {
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 {
699 699
     // Valeur par defaut
700 700
     $str = htmlspecialchars($str); // On protege la chaine
701
-    $max = (! is_numeric($max)) ? strlen($str) : $max; // Taille à couper
701
+    $max = (!is_numeric($max)) ? strlen($str) : $max; // Taille à couper
702 702
 
703 703
     $length = strlen($str); // Nombre de caractères
704 704
 
@@ -964,17 +964,17 @@  discard block
 block discarded – undo
964 964
 function scl_splitInt($nbr, $pas = 3, $separateur = ' ')
965 965
 {
966 966
     // Valeurs par défaut
967
-    if (! is_numeric($nbr)) {
967
+    if (!is_numeric($nbr)) {
968 968
         return;
969 969
     }
970
-    $pas        = (! empty($pas) && is_int($pas)) ? $pas : 3;
970
+    $pas        = (!empty($pas) && is_int($pas)) ? $pas : 3;
971 971
     $separateur = (in_array($separateur, ['.', ' ', ',', '-', '/'], true)) ? $separateur : ' ';
972 972
 
973 973
     $return = ''; // Valeur renvoyée
974 974
 
975 975
     $nombre  = explode('.', $nbr);
976 976
     $nbr     = $nombre[0];
977
-    $virgule = (! empty($nombre[1])) ? '.' . $nombre[1] : '';
977
+    $virgule = (!empty($nombre[1])) ? '.' . $nombre[1] : '';
978 978
 
979 979
     $lenght = strlen($nbr); // nombre de chiffre
980 980
     $nbr    = strrev($nbr); // on inverse le nombre
@@ -1225,7 +1225,7 @@  discard block
 block discarded – undo
1225 1225
 
1226 1226
     $return .= $trio[1] . ' ' . $secon[1] . ' ' . $prim[1];
1227 1227
 
1228
-    if (! ($cent_c === '0' || $cent_c === '') || ! ($dix_c === '0' || $dix_c === '')) {
1228
+    if (!($cent_c === '0' || $cent_c === '') || !($dix_c === '0' || $dix_c === '')) {
1229 1229
         $return .= $trio_c . ' ' . $secon_c;
1230 1230
     }
1231 1231
 
Please login to merge, or discard this patch.
src/Cli/Commands/Generators/Controller.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
             } elseif ($rest) {
98 98
                 $rest = is_string($rest) ? $rest : 'controller';
99 99
 
100
-                if (! in_array($rest, ['controller', 'presenter'], true)) {
100
+                if (!in_array($rest, ['controller', 'presenter'], true)) {
101 101
                     // @codeCoverageIgnoreStart
102 102
                     $rest = $this->choice(lang('CLI.generator.parentClass'), ['controller', 'presenter']);
103 103
                     $this->newLine();
Please login to merge, or discard this patch.
src/Router/RouteBuilder.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     {
204 204
         $this->collection->presenter($name, $this->attributes + $options);
205 205
 
206
-		$this->attributes = [];
206
+        $this->attributes = [];
207 207
     }
208 208
 
209 209
     /**
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
     {
242 242
         $this->collection->resource($name, $this->attributes + $options);
243 243
 
244
-		$this->attributes = [];
244
+        $this->attributes = [];
245 245
     }
246 246
 
247 247
     /**
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
     {
290 290
         $this->collection->{$method}($from, $to, $this->attributes + $options);
291 291
 
292
-		$this->attributes = [];
292
+        $this->attributes = [];
293 293
 
294 294
         return $this;
295 295
     }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
         if (is_string($to)) {
164 164
             $parts = explode('::', $to);
165
-        } else if(is_array($to)) {
165
+        } else if (is_array($to)) {
166 166
             $parts = $to;
167 167
         } else {
168 168
             $parts = [];
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
      */
314 314
     private function attribute(string $key, $value): self
315 315
     {
316
-        if (! in_array($key, $this->allowedAttributes, true)) {
316
+        if (!in_array($key, $this->allowedAttributes, true)) {
317 317
             throw new InvalidArgumentException("L'attribute [{$key}] n'existe pas.");
318 318
         }
319 319
 
Please login to merge, or discard this patch.
src/Router/Router.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         // Toujours là ? Ensuite, nous pouvons essayer de faire correspondre l'URI avec
158 158
         // Contrôleurs/répertoires, mais l'application peut ne pas
159 159
         // vouloir ceci, comme dans le cas des API.
160
-        if (! $this->collection->shouldAutoRoute()) {
160
+        if (!$this->collection->shouldAutoRoute()) {
161 161
             throw new PageNotFoundException("Impossible de trouver une route pour '{$this->collection->getHTTPVerb()}: {$uri}'.");
162 162
         }
163 163
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
      */
188 188
     public function controllerName()
189 189
     {
190
-        if (! is_string($this->controller)) {
190
+        if (!is_string($this->controller)) {
191 191
             return $this->controller;
192 192
         }
193 193
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
             return [
229 229
                 $routeArray[0], // Controller
230
-                $routeArray[1] ?? 'index',   // Method
230
+                $routeArray[1] ?? 'index', // Method
231 231
             ];
232 232
         }
233 233
 
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
                 // Cette route est-elle censée rediriger vers une autre ?
352 352
                 if ($this->collection->isRedirect($routeKey)) {
353 353
                     // remplacement des groupes de routes correspondants par des références : post/([0-9]+) -> post/$1
354
-                    $redirectTo = preg_replace_callback('/(\([^\(]+\))/', static function () {
354
+                    $redirectTo = preg_replace_callback('/(\([^\(]+\))/', static function() {
355 355
                         static $i = 1;
356 356
 
357 357
                         return '$' . $i++;
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
                     );
372 372
 
373 373
                     if ($this->collection->shouldUseSupportedLocalesOnly()
374
-                        && ! in_array($matched['locale'], config('App')->supportedLocales, true)) {
374
+                        && !in_array($matched['locale'], config('App')->supportedLocales, true)) {
375 375
                         // Lancer une exception pour empêcher l'autorouteur,
376 376
                         // si activé, essayer de trouver une route
377 377
                         throw PageNotFoundException::localeNotSupported($matched['locale']);
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 
384 384
                 // Utilisons-nous Closures ? Si tel est le cas, nous devons collecter les paramètres dans un tableau
385 385
                 // afin qu'ils puissent être transmis ultérieurement à la méthode du contrôleur.
386
-                if (! is_string($handler) && is_callable($handler)) {
386
+                if (!is_string($handler) && is_callable($handler)) {
387 387
                     $this->controller = $handler;
388 388
 
389 389
                     // Supprime la chaîne d'origine du tableau matches
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 
460 460
         // $this->method contient déjà le nom de la méthode par défaut,
461 461
         // donc ne l'écrasez pas avec le vide.
462
-        if (! empty($method)) {
462
+        if (!empty($method)) {
463 463
             $this->setMethod($method);
464 464
         }
465 465
 
Please login to merge, or discard this patch.
src/Router/AutoRouter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             $class = $this->translateURIDashes(ucfirst($segment));
134 134
 
135 135
             // dès que nous rencontrons un segment qui n'est pas compatible PSR-4, arrêter la recherche
136
-            if (! $this->isValidSegment($class)) {
136
+            if (!$this->isValidSegment($class)) {
137 137
                 return false;
138 138
             }
139 139
 
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
             throw new MethodNotFoundException();
345 345
         }
346 346
 
347
-        if (! $refMethod->isPublic()) {
347
+        if (!$refMethod->isPublic()) {
348 348
             throw new MethodNotFoundException();
349 349
         }
350 350
 
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
      */
458 458
     public function directory(): string
459 459
     {
460
-        return ! empty($this->directory) ? $this->directory : '';
460
+        return !empty($this->directory) ? $this->directory : '';
461 461
     }
462 462
 
463 463
     /**
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
      */
468 468
     private function controllerName()
469 469
     {
470
-        if (! is_string($this->controller)) {
470
+        if (!is_string($this->controller)) {
471 471
             return $this->controller;
472 472
         }
473 473
 
Please login to merge, or discard this patch.
src/Cli/Commands/Routes/AutoRouteCollector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
125 125
             $i = 1;
126 126
 
127 127
             foreach ($route['params'] as $required) {
128
-                if ($longest && ! $required) {
128
+                if ($longest && !$required) {
129 129
                     $sampleUri .= '/' . $i++;
130 130
                 }
131 131
             }
Please login to merge, or discard this patch.