@@ -152,19 +152,19 @@ |
||
152 | 152 | */ |
153 | 153 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
154 | 154 | { |
155 | - if (! in_array($request->getMethod(), $this->methods, true)) { |
|
155 | + if (!in_array($request->getMethod(), $this->methods, true)) { |
|
156 | 156 | return $handler->handle($request); |
157 | 157 | } |
158 | 158 | |
159 | 159 | [$type] = explode(';', $request->getHeaderLine('Content-Type')); |
160 | 160 | $type = strtolower($type); |
161 | - if (! isset($this->parsers[$type])) { |
|
161 | + if (!isset($this->parsers[$type])) { |
|
162 | 162 | return $handler->handle($request); |
163 | 163 | } |
164 | 164 | |
165 | 165 | $parser = $this->parsers[$type]; |
166 | 166 | $result = $parser($request->getBody()->getContents()); |
167 | - if (! is_array($result)) { |
|
167 | + if (!is_array($result)) { |
|
168 | 168 | throw HttpException::badRequest(); |
169 | 169 | } |
170 | 170 | $request = $request->withParsedBody($result); |
@@ -63,12 +63,12 @@ |
||
63 | 63 | $group = on_test() ? 'test' : (on_prod() ? 'production' : 'development'); |
64 | 64 | } |
65 | 65 | |
66 | - if (! isset($config[$group])) { |
|
66 | + if (!isset($config[$group])) { |
|
67 | 67 | $group = 'default'; |
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | - if (is_string($group) && ! isset($config[$group]) && strpos($group, 'custom-') !== 0) { |
|
71 | + if (is_string($group) && !isset($config[$group]) && strpos($group, 'custom-') !== 0) { |
|
72 | 72 | throw new InvalidArgumentException($group . ' is not a valid database connection group.'); |
73 | 73 | } |
74 | 74 |
@@ -197,7 +197,7 @@ |
||
197 | 197 | $table = empty($table) ? $this->table : $table; |
198 | 198 | |
199 | 199 | // S'assurer qu'on a une bonne connxion a la base de donnees |
200 | - if (! $this->db instanceof ConnectionInterface) { |
|
200 | + if (!$this->db instanceof ConnectionInterface) { |
|
201 | 201 | $this->db = Database::connect($this->group); |
202 | 202 | } |
203 | 203 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | // ================================= FONCTIONS D'ACCESSIBILITE ================================= // |
24 | 24 | |
25 | -if (! function_exists('env')) { |
|
25 | +if (!function_exists('env')) { |
|
26 | 26 | /** |
27 | 27 | * Obtient une variable d'environnement à partir des sources disponibles et fournit une émulation |
28 | 28 | * pour les variables d'environnement non prises en charge ou incohérentes |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | } |
39 | 39 | } |
40 | 40 | |
41 | -if (! function_exists('helper')) { |
|
41 | +if (!function_exists('helper')) { |
|
42 | 42 | /** |
43 | 43 | * Charge un fichier d'aide en mémoire. Prend en charge les assistants d'espace de noms, |
44 | 44 | * à la fois dans et hors du répertoire 'helpers' d'un répertoire à espace de noms. |
@@ -56,7 +56,7 @@ discard block |
||
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 |
||
66 | 66 | * |
67 | 67 | * @return T |
68 | 68 | */ |
69 | - function model(string|array $name, array $options = [], ?ConnectionInterface &$conn = null) |
|
69 | + function model(string|array $name, array $options = [], ?ConnectionInterface&$conn = null) |
|
70 | 70 | { |
71 | 71 | return Load::model($name, $options, $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 |
||
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 |
||
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 |
||
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 | * |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | function config(string $config, $value = null, bool $force_set = false) |
125 | 125 | { |
126 | - if (! empty($value) || (empty($value) && true === $force_set)) { |
|
126 | + if (!empty($value) || (empty($value) && true === $force_set)) { |
|
127 | 127 | Config::set($config, $value); |
128 | 128 | } |
129 | 129 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | // =========================== FONCTIONS DE PREVENTION D'ATTAQUE =========================== // |
135 | 135 | |
136 | -if (! function_exists('esc')) { |
|
136 | +if (!function_exists('esc')) { |
|
137 | 137 | /** |
138 | 138 | * Effectue un simple échappement automatique des données pour des raisons de sécurité. |
139 | 139 | * Pourrait envisager de rendre cela plus complexe à une date ultérieure. |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | } |
161 | 161 | } |
162 | 162 | |
163 | -if (! function_exists('h')) { |
|
163 | +if (!function_exists('h')) { |
|
164 | 164 | /** |
165 | 165 | * Méthode pratique pour htmlspecialchars. |
166 | 166 | * |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | } |
180 | 180 | } |
181 | 181 | |
182 | -if (! function_exists('purify')) { |
|
182 | +if (!function_exists('purify')) { |
|
183 | 183 | /** |
184 | 184 | * Purifiez l'entrée à l'aide de la classe autonome HTMLPurifier. |
185 | 185 | * Utilisez facilement plusieurs configurations de purificateur. |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } |
198 | 198 | } |
199 | 199 | |
200 | -if (! function_exists('remove_invisible_characters')) { |
|
200 | +if (!function_exists('remove_invisible_characters')) { |
|
201 | 201 | /** |
202 | 202 | * Supprimer les caractères invisibles |
203 | 203 | * |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | } |
211 | 211 | } |
212 | 212 | |
213 | -if (! function_exists('stringify_attributes')) { |
|
213 | +if (!function_exists('stringify_attributes')) { |
|
214 | 214 | /** |
215 | 215 | * Chaîner les attributs à utiliser dans les balises HTML. |
216 | 216 | * |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | |
225 | 225 | // ================================= FONCTIONS D'ENVIRONNEMENT D'EXECUTION ================================= // |
226 | 226 | |
227 | -if (! function_exists('on_dev')) { |
|
227 | +if (!function_exists('on_dev')) { |
|
228 | 228 | /** |
229 | 229 | * Testez pour voir si nous sommes dans un environnement de développement. |
230 | 230 | */ |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | } |
241 | 241 | } |
242 | 242 | |
243 | -if (! function_exists('on_prod')) { |
|
243 | +if (!function_exists('on_prod')) { |
|
244 | 244 | /** |
245 | 245 | * Testez pour voir si nous sommes dans un environnement de production. |
246 | 246 | */ |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | } |
257 | 257 | } |
258 | 258 | |
259 | -if (! function_exists('on_test')) { |
|
259 | +if (!function_exists('on_test')) { |
|
260 | 260 | /** |
261 | 261 | * Testez pour voir si nous sommes dans un environnement de test |
262 | 262 | */ |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | } |
269 | 269 | } |
270 | 270 | |
271 | -if (! function_exists('is_cli')) { |
|
271 | +if (!function_exists('is_cli')) { |
|
272 | 272 | /** |
273 | 273 | * Testez pour voir si une demande a été faite à partir de la ligne de commande. |
274 | 274 | */ |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | } |
279 | 279 | } |
280 | 280 | |
281 | -if (! function_exists('is_php')) { |
|
281 | +if (!function_exists('is_php')) { |
|
282 | 282 | /** |
283 | 283 | * Détermine si la version actuelle de PHP est égale ou supérieure à la valeur fournie. |
284 | 284 | */ |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | } |
289 | 289 | } |
290 | 290 | |
291 | -if (! function_exists('is_windows')) { |
|
291 | +if (!function_exists('is_windows')) { |
|
292 | 292 | /** |
293 | 293 | * Déterminez si l'environnement actuel est basé sur Windows. |
294 | 294 | */ |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | } |
299 | 299 | } |
300 | 300 | |
301 | -if (! function_exists('is_https')) { |
|
301 | +if (!function_exists('is_https')) { |
|
302 | 302 | /** |
303 | 303 | * Determines if the application is accessed via an encrypted * (HTTPS) connection. |
304 | 304 | */ |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | } |
309 | 309 | } |
310 | 310 | |
311 | -if (! function_exists('is_localfile')) { |
|
311 | +if (!function_exists('is_localfile')) { |
|
312 | 312 | /** |
313 | 313 | * Vérifiez si le fichier auquel vous souhaitez accéder est un fichier local de votre application ou non |
314 | 314 | */ |
@@ -318,11 +318,11 @@ discard block |
||
318 | 318 | return true; |
319 | 319 | } |
320 | 320 | |
321 | - return ! preg_match('#^(https?://)#i', $name); |
|
321 | + return !preg_match('#^(https?://)#i', $name); |
|
322 | 322 | } |
323 | 323 | } |
324 | 324 | |
325 | -if (! function_exists('is_online')) { |
|
325 | +if (!function_exists('is_online')) { |
|
326 | 326 | /** |
327 | 327 | * Tester si l'application s'exécute en local ou en ligne. |
328 | 328 | */ |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | } |
333 | 333 | } |
334 | 334 | |
335 | -if (! function_exists('is_ajax_request')) { |
|
335 | +if (!function_exists('is_ajax_request')) { |
|
336 | 336 | /** |
337 | 337 | * Testez pour voir si une requête contient l'en-tête HTTP_X_REQUESTED_WITH. |
338 | 338 | */ |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | } |
343 | 343 | } |
344 | 344 | |
345 | -if (! function_exists('redirection')) { |
|
345 | +if (!function_exists('redirection')) { |
|
346 | 346 | /** |
347 | 347 | * Redirige l'utilisateur |
348 | 348 | */ |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | } |
357 | 357 | } |
358 | 358 | |
359 | -if (! function_exists('redirect')) { |
|
359 | +if (!function_exists('redirect')) { |
|
360 | 360 | /** |
361 | 361 | * Méthode pratique qui fonctionne avec la $request globale actuelle et |
362 | 362 | * l'instance $router à rediriger à l'aide de routes nommées et le routage inversé |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | { |
371 | 371 | $redirection = Services::redirection(); |
372 | 372 | |
373 | - if (! empty($uri)) { |
|
373 | + if (!empty($uri)) { |
|
374 | 374 | return $redirection->route($uri); |
375 | 375 | } |
376 | 376 | |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | } |
379 | 379 | } |
380 | 380 | |
381 | -if (! function_exists('link_to')) { |
|
381 | +if (!function_exists('link_to')) { |
|
382 | 382 | /** |
383 | 383 | * Étant donné une chaîne de contrôleur/méthode et tous les paramètres, |
384 | 384 | * tentera de créer l'URL relative à la route correspondante. |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | } |
395 | 395 | } |
396 | 396 | |
397 | -if (! function_exists('clean_path')) { |
|
397 | +if (!function_exists('clean_path')) { |
|
398 | 398 | /** |
399 | 399 | * Une méthode pratique pour nettoyer les chemins pour |
400 | 400 | * une sortie plus belle. Utile pour les exceptions |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | |
426 | 426 | // ================================= FONCTIONS DE DEBOGAGE ================================= // |
427 | 427 | |
428 | -if (! function_exists('dd')) { |
|
428 | +if (!function_exists('dd')) { |
|
429 | 429 | /** |
430 | 430 | * Prints a Kint debug report and exits. |
431 | 431 | * |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | } |
445 | 445 | } |
446 | 446 | |
447 | -if (! function_exists('dump')) { |
|
447 | +if (!function_exists('dump')) { |
|
448 | 448 | /** |
449 | 449 | * Prints a Kint debug report and exits. |
450 | 450 | * |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | } |
462 | 462 | } |
463 | 463 | |
464 | -if (! function_exists('deprecationWarning')) { |
|
464 | +if (!function_exists('deprecationWarning')) { |
|
465 | 465 | /** |
466 | 466 | * Méthode d'assistance pour générer des avertissements d'obsolescence |
467 | 467 | * |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | } |
478 | 478 | } |
479 | 479 | |
480 | -if (! function_exists('logger')) { |
|
480 | +if (!function_exists('logger')) { |
|
481 | 481 | /** |
482 | 482 | * A convenience/compatibility method for logging events through |
483 | 483 | * the Log system. |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | { |
501 | 501 | $logger = Services::logger(); |
502 | 502 | |
503 | - if (! empty($level) && ! empty($message)) { |
|
503 | + if (!empty($level) && !empty($message)) { |
|
504 | 504 | return $logger->log($level, $message, $context); |
505 | 505 | } |
506 | 506 | |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | } |
509 | 509 | } |
510 | 510 | |
511 | -if (! function_exists('cache')) { |
|
511 | +if (!function_exists('cache')) { |
|
512 | 512 | /** |
513 | 513 | * Une méthode pratique qui donne accès au cache |
514 | 514 | * objet. Si aucun paramètre n'est fourni, renverra l'objet, |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | } |
539 | 539 | } |
540 | 540 | |
541 | -if (! function_exists('pr')) { |
|
541 | +if (!function_exists('pr')) { |
|
542 | 542 | /** |
543 | 543 | * print_r() convenience function. |
544 | 544 | * |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | } |
561 | 561 | } |
562 | 562 | |
563 | -if (! function_exists('pj')) { |
|
563 | +if (!function_exists('pj')) { |
|
564 | 564 | /** |
565 | 565 | * json pretty print convenience function. |
566 | 566 | * |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | } |
582 | 582 | } |
583 | 583 | |
584 | -if (! function_exists('trigger_warning')) { |
|
584 | +if (!function_exists('trigger_warning')) { |
|
585 | 585 | /** |
586 | 586 | * Déclenche un E_USER_WARNING. |
587 | 587 | */ |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | } |
592 | 592 | } |
593 | 593 | |
594 | -if (! function_exists('vd')) { |
|
594 | +if (!function_exists('vd')) { |
|
595 | 595 | /** |
596 | 596 | * Shortcut to ref, HTML mode |
597 | 597 | * |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | } |
604 | 604 | } |
605 | 605 | |
606 | -if (! function_exists('vdt')) { |
|
606 | +if (!function_exists('vdt')) { |
|
607 | 607 | /** |
608 | 608 | * Shortcut to ref, plain text mode |
609 | 609 | * |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | |
618 | 618 | // ================================= FONCTIONS DIVERSES ================================= // |
619 | 619 | |
620 | -if (! function_exists('force_https')) { |
|
620 | +if (!function_exists('force_https')) { |
|
621 | 621 | /** |
622 | 622 | * Utilisé pour forcer l'accès à une page via HTTPS. |
623 | 623 | * Utilise une redirection standard, plus définira l'en-tête HSTS |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | } |
676 | 676 | } |
677 | 677 | |
678 | -if (! function_exists('getTypeName')) { |
|
678 | +if (!function_exists('getTypeName')) { |
|
679 | 679 | /** |
680 | 680 | * Renvoie la classe d'objets ou le type var de ce n'est pas un objet |
681 | 681 | * |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | } |
690 | 690 | } |
691 | 691 | |
692 | -if (! function_exists('ip_address')) { |
|
692 | +if (!function_exists('ip_address')) { |
|
693 | 693 | /** |
694 | 694 | * Renvoie l'adresse IP de l'utilisateur actuel |
695 | 695 | */ |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | } |
700 | 700 | } |
701 | 701 | |
702 | -if (! function_exists('is_really_writable')) { |
|
702 | +if (!function_exists('is_really_writable')) { |
|
703 | 703 | /** |
704 | 704 | * Tests d'inscriptibilité des fichiers |
705 | 705 | */ |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | } |
711 | 711 | } |
712 | 712 | |
713 | -if (! function_exists('lang')) { |
|
713 | +if (!function_exists('lang')) { |
|
714 | 714 | /** |
715 | 715 | * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater |
716 | 716 | * le résultat avec le MessageFormatter de l'extension intl. |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | } |
727 | 727 | } |
728 | 728 | |
729 | -if (! function_exists('namespaceSplit')) { |
|
729 | +if (!function_exists('namespaceSplit')) { |
|
730 | 730 | /** |
731 | 731 | * Séparez l'espace de noms du nom de classe. |
732 | 732 | * |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | } |
748 | 748 | } |
749 | 749 | |
750 | -if (! function_exists('view_exist')) { |
|
750 | +if (!function_exists('view_exist')) { |
|
751 | 751 | /** |
752 | 752 | * Verifie si un fichier de vue existe. Utile pour limiter les failles include |
753 | 753 | */ |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | } |
762 | 762 | } |
763 | 763 | |
764 | -if (! function_exists('view')) { |
|
764 | +if (!function_exists('view')) { |
|
765 | 765 | /** |
766 | 766 | * Charge une vue |
767 | 767 | * |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | } |
778 | 778 | } |
779 | 779 | |
780 | -if (! function_exists('flash')) { |
|
780 | +if (!function_exists('flash')) { |
|
781 | 781 | /** |
782 | 782 | * Fournisseur d'acces rapide a la classe PHP Flash |
783 | 783 | * |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | }*/ |
810 | 810 | } |
811 | 811 | |
812 | -if (! function_exists('geo_ip')) { |
|
812 | +if (!function_exists('geo_ip')) { |
|
813 | 813 | /** |
814 | 814 | * Recuperation des coordonnees (pays, ville, etc) d'un utilisateur en fonction de son ip |
815 | 815 | */ |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | } |
820 | 820 | } |
821 | 821 | |
822 | -if (! function_exists('to_stream')) { |
|
822 | +if (!function_exists('to_stream')) { |
|
823 | 823 | /** |
824 | 824 | * Créez un nouveau flux basé sur le type d'entrée. |
825 | 825 | * |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | } |
843 | 843 | } |
844 | 844 | |
845 | -if (! function_exists('value')) { |
|
845 | +if (!function_exists('value')) { |
|
846 | 846 | /** |
847 | 847 | * Renvoie la valeur par défaut de la valeur donnée. |
848 | 848 | * |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | } |
857 | 857 | } |
858 | 858 | |
859 | -if (! function_exists('with')) { |
|
859 | +if (!function_exists('with')) { |
|
860 | 860 | /** |
861 | 861 | * Renvoie la valeur donnée, éventuellement transmise via le rappel donné. |
862 | 862 | * |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | { |
26 | 26 | static $_is_php; |
27 | 27 | |
28 | - if (! isset($_is_php[$version])) { |
|
28 | + if (!isset($_is_php[$version])) { |
|
29 | 29 | $_is_php[$version] = version_compare(PHP_VERSION, $version, '>='); |
30 | 30 | } |
31 | 31 | |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | $host = explode(':', $_SERVER['HTTP_HOST'] ?? '')[0]; |
41 | 41 | |
42 | 42 | return |
43 | - ! empty($host) // Si c'est vide, ca veut certainement dire qu'on est en CLI, or le CLI << n'est pas >> utilisé en ligne |
|
44 | - && ! in_array($host, ['localhost', '127.0.0.1'], true) |
|
45 | - && ! preg_match('#\.dev$#', $host) |
|
46 | - && ! preg_match('#\.test$#', $host) |
|
47 | - && ! preg_match('#\.lab$#', $host) |
|
48 | - && ! preg_match('#\.loc(al)?$#', $host) |
|
49 | - && ! preg_match('#^192\.168#', $host); |
|
43 | + !empty($host) // Si c'est vide, ca veut certainement dire qu'on est en CLI, or le CLI << n'est pas >> utilisé en ligne |
|
44 | + && !in_array($host, ['localhost', '127.0.0.1'], true) |
|
45 | + && !preg_match('#\.dev$#', $host) |
|
46 | + && !preg_match('#\.test$#', $host) |
|
47 | + && !preg_match('#\.lab$#', $host) |
|
48 | + && !preg_match('#\.loc(al)?$#', $host) |
|
49 | + && !preg_match('#^192\.168#', $host); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | public static function isReallyWritable(string $file): bool |
66 | 66 | { |
67 | 67 | // If we're on a Unix server with safe_mode off we call is_writable |
68 | - if (DIRECTORY_SEPARATOR === '/' || ! ini_get('safe_mode')) { |
|
68 | + if (DIRECTORY_SEPARATOR === '/' || !ini_get('safe_mode')) { |
|
69 | 69 | return is_writable($file); |
70 | 70 | } |
71 | 71 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | return true; |
86 | 86 | } |
87 | - if (! is_file($file) || ($fp = @fopen($file, 'ab')) === false) { |
|
87 | + if (!is_file($file) || ($fp = @fopen($file, 'ab')) === false) { |
|
88 | 88 | return false; |
89 | 89 | } |
90 | 90 | |
@@ -98,23 +98,23 @@ discard block |
||
98 | 98 | $path = parse_url($url); |
99 | 99 | $query = ''; |
100 | 100 | |
101 | - if (! empty($path['host'])) { |
|
101 | + if (!empty($path['host'])) { |
|
102 | 102 | $r = $path['scheme'] . '://'; |
103 | - if (! empty($path['user'])) { |
|
103 | + if (!empty($path['user'])) { |
|
104 | 104 | $r .= $path['user']; |
105 | - if (! empty($path['pass'])) { |
|
105 | + if (!empty($path['pass'])) { |
|
106 | 106 | $r .= ':' . $path['pass'] . '@'; |
107 | 107 | } |
108 | 108 | $r .= '@'; |
109 | 109 | } |
110 | - if (! empty($path['host'])) { |
|
110 | + if (!empty($path['host'])) { |
|
111 | 111 | $r .= $path['host']; |
112 | 112 | } |
113 | - if (! empty($path['port'])) { |
|
113 | + if (!empty($path['port'])) { |
|
114 | 114 | $r .= ':' . $path['port']; |
115 | 115 | } |
116 | 116 | $url = $r . $path['path']; |
117 | - if (! empty($path['query'])) { |
|
117 | + if (!empty($path['query'])) { |
|
118 | 118 | $query = '?' . $path['query']; |
119 | 119 | } |
120 | 120 | } |
@@ -138,12 +138,12 @@ discard block |
||
138 | 138 | $non_displayables = []; |
139 | 139 | |
140 | 140 | if ($url_encoded) { |
141 | - $non_displayables[] = '/%0[0-8bcef]/i'; // url encoded 00-08, 11, 12, 14, 15 |
|
142 | - $non_displayables[] = '/%1[0-9a-f]/i'; // url encoded 16-31 |
|
143 | - $non_displayables[] = '/%7f/i'; // url encoded 127 |
|
141 | + $non_displayables[] = '/%0[0-8bcef]/i'; // url encoded 00-08, 11, 12, 14, 15 |
|
142 | + $non_displayables[] = '/%1[0-9a-f]/i'; // url encoded 16-31 |
|
143 | + $non_displayables[] = '/%7f/i'; // url encoded 127 |
|
144 | 144 | } |
145 | 145 | |
146 | - $non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S'; // 00-08, 11, 12, 14-31, 127 |
|
146 | + $non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S'; // 00-08, 11, 12, 14-31, 127 |
|
147 | 147 | |
148 | 148 | do { |
149 | 149 | $str = preg_replace($non_displayables, '', $str, -1, $count); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | return $data; |
187 | 187 | } |
188 | 188 | |
189 | - if (! in_array($context, ['html', 'js', 'css', 'url', 'attr'], true)) { |
|
189 | + if (!in_array($context, ['html', 'js', 'css', 'url', 'attr'], true)) { |
|
190 | 190 | throw new InvalidArgumentException('Invalid escape context provided.'); |
191 | 191 | } |
192 | 192 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } |
198 | 198 | |
199 | 199 | static $escaper; |
200 | - if (! $escaper) { |
|
200 | + if (!$escaper) { |
|
201 | 201 | $escaper = new \Laminas\Escaper\Escaper($encoding); |
202 | 202 | } |
203 | 203 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | $double = true; |
264 | 264 | } |
265 | 265 | |
266 | - return htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, $charset ?: $defaultCharset, $double); |
|
266 | + return htmlspecialchars($text, ENT_QUOTES|ENT_SUBSTITUTE, $charset ?: $defaultCharset, $double); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | /** |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | { |
373 | 373 | if ($key === 'HTTPS') { |
374 | 374 | if (isset($_SERVER['HTTPS'])) { |
375 | - return ! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'; |
|
375 | + return !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'; |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | return strpos((string) self::env('SCRIPT_URI'), 'https://') === 0; |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $name = (string) self::env('SCRIPT_NAME'); |
404 | 404 | $filename = (string) self::env('SCRIPT_FILENAME'); |
405 | 405 | $offset = 0; |
406 | - if (! strpos($name, '.php')) { |
|
406 | + if (!strpos($name, '.php')) { |
|
407 | 407 | $offset = 4; |
408 | 408 | } |
409 | 409 | |
@@ -428,13 +428,13 @@ discard block |
||
428 | 428 | $server_addr = $_SERVER['HTTP_HOST'] ?? ((strpos($_SERVER['SERVER_ADDR'], ':') !== false) ? '[' . $_SERVER['SERVER_ADDR'] . ']' : $_SERVER['SERVER_ADDR']); |
429 | 429 | |
430 | 430 | if (isset($_SERVER['SERVER_PORT'])) { |
431 | - $server_addr .= ':' . ((! preg_match('#:' . $_SERVER['SERVER_PORT'] . '$#', $server_addr)) ? $_SERVER['SERVER_PORT'] : '80'); |
|
431 | + $server_addr .= ':' . ((!preg_match('#:' . $_SERVER['SERVER_PORT'] . '$#', $server_addr)) ? $_SERVER['SERVER_PORT'] : '80'); |
|
432 | 432 | } |
433 | 433 | |
434 | 434 | if ( |
435 | - (! empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') |
|
435 | + (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') |
|
436 | 436 | || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) === 'https') |
437 | - || (! empty($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off') |
|
437 | + || (!empty($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off') |
|
438 | 438 | ) { |
439 | 439 | $base_url = 'https'; |
440 | 440 | } else { |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | */ |
483 | 483 | public static function deprecationWarning(string $message, int $stackFrame = 1) |
484 | 484 | { |
485 | - if (! (error_reporting() & E_USER_DEPRECATED)) { |
|
485 | + if (!(error_reporting() & E_USER_DEPRECATED)) { |
|
486 | 486 | return; |
487 | 487 | } |
488 | 488 |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | foreach (Filesystem::allFiles($path) as $file) { |
140 | 140 | $name = str_replace([$path, '.' . $file->getExtension(), DS], ['', '', '\\'], $file->getPathname()); |
141 | 141 | |
142 | - if (! Str::contains($name, 'Generators' . DS . 'Views')) { |
|
142 | + if (!Str::contains($name, 'Generators' . DS . 'Views')) { |
|
143 | 143 | $this->addCommand('\BlitzPHP\Cli\Commands\\' . $name); |
144 | 144 | } |
145 | 145 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | private function addCommand(string $commandName) |
164 | 164 | { |
165 | - if (! class_exists($commandName)) { |
|
165 | + if (!class_exists($commandName)) { |
|
166 | 166 | throw new CLIException("La classe `{$commandName}` n'existe pas"); |
167 | 167 | } |
168 | 168 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | $instance = new $commandName($this, Services::logger()); |
173 | 173 | |
174 | - if (! ($instance instanceof Command)) { |
|
174 | + if (!($instance instanceof Command)) { |
|
175 | 175 | throw CLIException::invalidCommand($commandName); |
176 | 176 | } |
177 | 177 | |
@@ -193,13 +193,13 @@ discard block |
||
193 | 193 | $value = (array) $value; |
194 | 194 | |
195 | 195 | $description = $value[0]; |
196 | - if (! is_string($description)) { |
|
196 | + if (!is_string($description)) { |
|
197 | 197 | continue; |
198 | 198 | } |
199 | 199 | |
200 | 200 | $default = $value[1] ?? null; |
201 | 201 | $filter = $value[2] ?? null; |
202 | - if ($filter !== null && ! is_callable($filter)) { |
|
202 | + if ($filter !== null && !is_callable($filter)) { |
|
203 | 203 | $filter = null; |
204 | 204 | } |
205 | 205 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $value = (array) $value; |
212 | 212 | |
213 | 213 | $description = $value[0]; |
214 | - if (! is_string($description)) { |
|
214 | + if (!is_string($description)) { |
|
215 | 215 | continue; |
216 | 216 | } |
217 | 217 | |
@@ -222,14 +222,14 @@ discard block |
||
222 | 222 | |
223 | 223 | $console = $this; |
224 | 224 | |
225 | - $command->action(static function () use ($instance, $command, $console) { |
|
226 | - if (! $console->suppress) { |
|
225 | + $command->action(static function() use ($instance, $command, $console) { |
|
226 | + if (!$console->suppress) { |
|
227 | 227 | $console->start($instance->service); |
228 | 228 | } |
229 | 229 | |
230 | 230 | $result = $instance->execute($command->values(false)); |
231 | 231 | |
232 | - if (! $console->suppress) { |
|
232 | + if (!$console->suppress) { |
|
233 | 233 | $console->end(); |
234 | 234 | } |
235 | 235 |
@@ -147,7 +147,7 @@ |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | if ($options['preferApp'] === true) { |
150 | - // $model = self::getBasename($model); |
|
150 | + // $model = self::getBasename($model); |
|
151 | 151 | |
152 | 152 | $model = str_replace(APP_NAMESPACE . '\\Models\\', '', $model); |
153 | 153 | $model = APP_NAMESPACE . '\\Models\\' . $model; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | foreach ($paths as $path) { |
45 | 45 | if (file_exists($path)) { |
46 | - if (! in_array($path, get_included_files(), true)) { |
|
46 | + if (!in_array($path, get_included_files(), true)) { |
|
47 | 47 | $languages = array_merge($languages, (array) require($path)); |
48 | 48 | } |
49 | 49 | $file_exist = true; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | throw LoadException::libraryNotFound($lib); |
121 | 121 | } |
122 | 122 | |
123 | - if (true !== $file_syst && ! class_exists($lib)) { |
|
123 | + if (true !== $file_syst && !class_exists($lib)) { |
|
124 | 124 | throw LoadException::libraryDontExist($lib); |
125 | 125 | } |
126 | 126 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | 'preferApp' => true |
143 | 143 | ], $options); |
144 | 144 | |
145 | - if (! preg_match('#Model$#', $model)) { |
|
145 | + if (!preg_match('#Model$#', $model)) { |
|
146 | 146 | $model .= 'Model'; |
147 | 147 | } |
148 | 148 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $model = APP_NAMESPACE . '\\Models\\' . $model; |
154 | 154 | } |
155 | 155 | |
156 | - if (! class_exists($model)) { |
|
156 | + if (!class_exists($model)) { |
|
157 | 157 | throw LoadException::modelNotFound($model); |
158 | 158 | } |
159 | 159 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $controller = explode('/', $controller); |
172 | 172 | |
173 | 173 | $con = ucfirst(end($controller)); |
174 | - $con = (! preg_match('#Controller$#', $con)) ? $con . 'Controller' : $con; |
|
174 | + $con = (!preg_match('#Controller$#', $con)) ? $con . 'Controller' : $con; |
|
175 | 175 | $controller[count($controller) - 1] = $con; |
176 | 176 | |
177 | 177 | foreach ($controller as $key => &$value) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | $path = CONTROLLER_PATH . Helpers::ensureExt(implode(DS, $controller), 'php'); |
184 | 184 | |
185 | - if (! file_exists($path)) { |
|
185 | + if (!file_exists($path)) { |
|
186 | 186 | throw LoadException::controllerNotFound(str_replace('Controller', '', $con), $path); |
187 | 187 | } |
188 | 188 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | if (class_exists($class_namespaced, false)) { |
194 | 194 | return Injector::make($class_namespaced); |
195 | 195 | } |
196 | - if (! class_exists($con, false)) { |
|
196 | + if (!class_exists($con, false)) { |
|
197 | 197 | throw LoadException::controllerDontExist(str_replace('Controller', '', $con), $path); |
198 | 198 | } |
199 | 199 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | protected static function verifyPreferApp(array $options, string $name): bool |
223 | 223 | { |
224 | 224 | // Tout element sans restriction passe |
225 | - if (! $options['preferApp']) { |
|
225 | + if (!$options['preferApp']) { |
|
226 | 226 | return true; |
227 | 227 | } |
228 | 228 |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $this->cookies = $config['cookies']; |
258 | 258 | |
259 | 259 | if (isset($config['uri'])) { |
260 | - if (! $config['uri'] instanceof UriInterface) { |
|
260 | + if (!$config['uri'] instanceof UriInterface) { |
|
261 | 261 | throw new FrameworkException('The `uri` key must be an instance of ' . UriInterface::class); |
262 | 262 | } |
263 | 263 | $uri = $config['uri']; |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | $ref = $this->getEnv('HTTP_REFERER'); |
398 | 398 | |
399 | 399 | $base = /* Configure::read('App.fullBaseUrl') . */ $this->webroot; |
400 | - if (! empty($ref) && ! empty($base)) { |
|
400 | + if (!empty($ref) && !empty($base)) { |
|
401 | 401 | if ($local && strpos($ref, $base) === 0) { |
402 | 402 | $ref = substr($ref, strlen($base)); |
403 | 403 | if ($ref === '' || strpos($ref, '//') === 0) { |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | |
410 | 410 | return $ref; |
411 | 411 | } |
412 | - if (! $local) { |
|
412 | + if (!$local) { |
|
413 | 413 | return $ref; |
414 | 414 | } |
415 | 415 | } |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | } |
462 | 462 | |
463 | 463 | $type = strtolower($type); |
464 | - if (! isset(static::$_detectors[$type])) { |
|
464 | + if (!isset(static::$_detectors[$type])) { |
|
465 | 465 | return false; |
466 | 466 | } |
467 | 467 | if ($args) { |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | foreach ($detect['header'] as $header => $value) { |
541 | 541 | $header = $this->getEnv('http_' . $header); |
542 | 542 | if ($header !== null) { |
543 | - if (! is_string($value) && ! is_bool($value) && is_callable($value)) { |
|
543 | + if (!is_string($value) && !is_bool($value) && is_callable($value)) { |
|
544 | 544 | return $value($header); |
545 | 545 | } |
546 | 546 | |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | public function isAll(array $types): bool |
614 | 614 | { |
615 | 615 | foreach ($types as $type) { |
616 | - if (! $this->is($type)) { |
|
616 | + if (!$this->is($type)) { |
|
617 | 617 | return false; |
618 | 618 | } |
619 | 619 | } |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | protected function normalizeHeaderName(string $name): string |
717 | 717 | { |
718 | 718 | $name = str_replace('-', '_', strtoupper($name)); |
719 | - if (! in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) { |
|
719 | + if (!in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) { |
|
720 | 720 | $name = 'HTTP_' . $name; |
721 | 721 | } |
722 | 722 | |
@@ -899,8 +899,8 @@ discard block |
||
899 | 899 | $new = clone $this; |
900 | 900 | |
901 | 901 | if ( |
902 | - ! is_string($method) |
|
903 | - || ! preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method) |
|
902 | + !is_string($method) |
|
903 | + || !preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method) |
|
904 | 904 | ) { |
905 | 905 | throw new InvalidArgumentException(sprintf( |
906 | 906 | 'Unsupported HTTP method "%s" provided', |
@@ -1144,7 +1144,7 @@ discard block |
||
1144 | 1144 | } |
1145 | 1145 | } |
1146 | 1146 | |
1147 | - if (! isset($accept[$prefValue])) { |
|
1147 | + if (!isset($accept[$prefValue])) { |
|
1148 | 1148 | $accept[$prefValue] = []; |
1149 | 1149 | } |
1150 | 1150 | if ($prefValue) { |
@@ -1222,7 +1222,7 @@ discard block |
||
1222 | 1222 | if ($name === null) { |
1223 | 1223 | return $this->data; |
1224 | 1224 | } |
1225 | - if (! is_array($this->data) && $name) { |
|
1225 | + if (!is_array($this->data) && $name) { |
|
1226 | 1226 | return $default; |
1227 | 1227 | } |
1228 | 1228 | |
@@ -1363,7 +1363,7 @@ discard block |
||
1363 | 1363 | */ |
1364 | 1364 | public function withProtocolVersion($version): self |
1365 | 1365 | { |
1366 | - if (! preg_match('/^(1\.[01]|2)$/', $version)) { |
|
1366 | + if (!preg_match('/^(1\.[01]|2)$/', $version)) { |
|
1367 | 1367 | throw new InvalidArgumentException("Unsupported protocol version '{$version}' provided"); |
1368 | 1368 | } |
1369 | 1369 | $new = clone $this; |
@@ -1385,7 +1385,7 @@ discard block |
||
1385 | 1385 | public function getEnv(string $key, ?string $default = null): ?string |
1386 | 1386 | { |
1387 | 1387 | $key = strtoupper($key); |
1388 | - if (! array_key_exists($key, $this->_environment)) { |
|
1388 | + if (!array_key_exists($key, $this->_environment)) { |
|
1389 | 1389 | $this->_environment[$key] = env($key); |
1390 | 1390 | } |
1391 | 1391 | |
@@ -1597,7 +1597,7 @@ discard block |
||
1597 | 1597 | $file = Arr::get($this->uploadedFiles, $path); |
1598 | 1598 | if (is_array($file)) { |
1599 | 1599 | foreach ($file as $f) { |
1600 | - if (! ($f instanceof UploadedFile)) { |
|
1600 | + if (!($f instanceof UploadedFile)) { |
|
1601 | 1601 | return null; |
1602 | 1602 | } |
1603 | 1603 | } |
@@ -1605,7 +1605,7 @@ discard block |
||
1605 | 1605 | return $file; |
1606 | 1606 | } |
1607 | 1607 | |
1608 | - if (! ($file instanceof UploadedFileInterface)) { |
|
1608 | + if (!($file instanceof UploadedFileInterface)) { |
|
1609 | 1609 | return null; |
1610 | 1610 | } |
1611 | 1611 | |
@@ -1653,7 +1653,7 @@ discard block |
||
1653 | 1653 | continue; |
1654 | 1654 | } |
1655 | 1655 | |
1656 | - if (! $file instanceof UploadedFileInterface) { |
|
1656 | + if (!$file instanceof UploadedFileInterface) { |
|
1657 | 1657 | throw new InvalidArgumentException("Invalid file at '{$path}{$key}'"); |
1658 | 1658 | } |
1659 | 1659 | } |
@@ -1704,7 +1704,7 @@ discard block |
||
1704 | 1704 | } |
1705 | 1705 | |
1706 | 1706 | $host = $uri->getHost(); |
1707 | - if (! $host) { |
|
1707 | + if (!$host) { |
|
1708 | 1708 | return $new; |
1709 | 1709 | } |
1710 | 1710 | $port = $uri->getPort(); |
@@ -1812,7 +1812,7 @@ discard block |
||
1812 | 1812 | $validLocales = config('app.supported_locales'); |
1813 | 1813 | // S'il ne s'agit pas d'un paramètre régional valide, définissez-le |
1814 | 1814 | // aux paramètres régionaux par défaut du site. |
1815 | - if (! in_array($locale, $validLocales, true)) { |
|
1815 | + if (!in_array($locale, $validLocales, true)) { |
|
1816 | 1816 | $locale = config('app.language'); |
1817 | 1817 | } |
1818 | 1818 | |
@@ -1912,7 +1912,7 @@ discard block |
||
1912 | 1912 | $override = true; |
1913 | 1913 | } |
1914 | 1914 | |
1915 | - if ($override && ! in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
1915 | + if ($override && !in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
1916 | 1916 | $data = []; |
1917 | 1917 | } |
1918 | 1918 | |
@@ -1961,7 +1961,7 @@ discard block |
||
1961 | 1961 | */ |
1962 | 1962 | protected function _processFiles(array $post, array $files): array |
1963 | 1963 | { |
1964 | - if (! is_array($files)) { |
|
1964 | + if (!is_array($files)) { |
|
1965 | 1965 | return $post; |
1966 | 1966 | } |
1967 | 1967 |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | $this->renderVars['file'] = str_replace('/', DS, rtrim($options['viewPath'] ?? $this->viewPath, '/\\') . DS . ltrim($this->renderVars['view'], '/\\')); |
127 | 127 | |
128 | - if (! is_file($this->renderVars['file'])) { |
|
128 | + if (!is_file($this->renderVars['file'])) { |
|
129 | 129 | throw ViewException::invalidFile($this->renderVars['view']); |
130 | 130 | } |
131 | 131 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | // Enregistrer les variables actuelles |
136 | 136 | $renderVars = $this->renderVars; |
137 | 137 | |
138 | - $output = (function (): string { |
|
138 | + $output = (function(): string { |
|
139 | 139 | extract($this->tempData); |
140 | 140 | ob_start(); |
141 | 141 | include $this->renderVars['file']; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | $this->logPerformance($this->renderVars['start'], microtime(true), $this->renderVars['view']); |
163 | 163 | |
164 | - if (($this->debug && (! isset($options['debug']) || $options['debug'] === true))) { |
|
164 | + if (($this->debug && (!isset($options['debug']) || $options['debug'] === true))) { |
|
165 | 165 | // Nettoyer nos noms de chemins pour les rendre un peu plus propres |
166 | 166 | $this->renderVars['file'] = clean_path($this->renderVars['file']); |
167 | 167 | $this->renderVars['file'] = ++$this->viewsCount . ' ' . $this->renderVars['file']; |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $saveData ??= $this->saveData; |
191 | 191 | $this->prepareTemplateData($saveData); |
192 | 192 | |
193 | - $output = (function (string $view): string { |
|
193 | + $output = (function(string $view): string { |
|
194 | 194 | extract($this->tempData); |
195 | 195 | ob_start(); |
196 | 196 | eval('?>' . $view); |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | $section = array_pop($this->sectionStack); |
319 | 319 | |
320 | 320 | // Assurez-vous qu'un tableau existe afin que nous puissions stocker plusieurs entrées pour cela. |
321 | - if (! array_key_exists($section, $this->sections)) { |
|
321 | + if (!array_key_exists($section, $this->sections)) { |
|
322 | 322 | $this->sections[$section] = []; |
323 | 323 | } |
324 | 324 | |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | */ |
355 | 355 | public function show(string $sectionName) |
356 | 356 | { |
357 | - if (! isset($this->sections[$sectionName])) { |
|
357 | + if (!isset($this->sections[$sectionName])) { |
|
358 | 358 | echo ''; |
359 | 359 | |
360 | 360 | return; |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | * |
424 | 424 | * @param mixed $saveData |
425 | 425 | */ |
426 | - public function include(string $view, ?array $data = [], ?array $options = null, $saveData = true): string |
|
426 | + public function include(string $view, ?array $data = [], ?array $options = null, $saveData = true) : string |
|
427 | 427 | { |
428 | 428 | return $this->insert($view, $data, $options, $saveData); |
429 | 429 | } |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | public function addLibCss(string ...$src): self |
435 | 435 | { |
436 | 436 | foreach ($src as $var) { |
437 | - if (! in_array($var, $this->_lib_styles, true)) { |
|
437 | + if (!in_array($var, $this->_lib_styles, true)) { |
|
438 | 438 | $this->_lib_styles[] = $var; |
439 | 439 | } |
440 | 440 | } |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | public function addCss(string ...$src): self |
449 | 449 | { |
450 | 450 | foreach ($src as $var) { |
451 | - if (! in_array($var, $this->_styles, true)) { |
|
451 | + if (!in_array($var, $this->_styles, true)) { |
|
452 | 452 | $this->_styles[] = $var; |
453 | 453 | } |
454 | 454 | } |
@@ -477,10 +477,10 @@ discard block |
||
477 | 477 | ); |
478 | 478 | } |
479 | 479 | |
480 | - if (! empty($lib_styles)) { |
|
480 | + if (!empty($lib_styles)) { |
|
481 | 481 | lib_styles(array_unique($lib_styles)); |
482 | 482 | } |
483 | - if (! empty($styles)) { |
|
483 | + if (!empty($styles)) { |
|
484 | 484 | styles(array_unique($styles)); |
485 | 485 | } |
486 | 486 | |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | public function addLibJs(string ...$src): self |
494 | 494 | { |
495 | 495 | foreach ($src as $var) { |
496 | - if (! in_array($var, $this->_lib_scripts, true)) { |
|
496 | + if (!in_array($var, $this->_lib_scripts, true)) { |
|
497 | 497 | $this->_lib_scripts[] = $var; |
498 | 498 | } |
499 | 499 | } |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | public function addJs(string ...$src): self |
508 | 508 | { |
509 | 509 | foreach ($src as $var) { |
510 | - if (! in_array($var, $this->_scripts, true)) { |
|
510 | + if (!in_array($var, $this->_scripts, true)) { |
|
511 | 511 | $this->_scripts[] = $var; |
512 | 512 | } |
513 | 513 | } |
@@ -536,10 +536,10 @@ discard block |
||
536 | 536 | ); |
537 | 537 | } |
538 | 538 | |
539 | - if (! empty($lib_scripts)) { |
|
539 | + if (!empty($lib_scripts)) { |
|
540 | 540 | lib_scripts(array_unique($lib_scripts)); |
541 | 541 | } |
542 | - if (! empty($scripts)) { |
|
542 | + if (!empty($scripts)) { |
|
543 | 543 | scripts(array_unique($scripts)); |
544 | 544 | } |
545 | 545 |