@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | { |
74 | 74 | $key = $this->_key($key); |
75 | 75 | |
76 | - if (! isset($this->cache[$key])) { |
|
76 | + if (!isset($this->cache[$key])) { |
|
77 | 77 | return false; |
78 | 78 | } |
79 | 79 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | if ($data === null) { |
113 | 113 | $data = 0; |
114 | - } elseif (! is_int($data)) { |
|
114 | + } elseif (!is_int($data)) { |
|
115 | 115 | return false; |
116 | 116 | } |
117 | 117 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | if ($data === null) { |
131 | 131 | $data = 0; |
132 | - } elseif (! is_int($data)) { |
|
132 | + } elseif (!is_int($data)) { |
|
133 | 133 | return false; |
134 | 134 | } |
135 | 135 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | public function getMetaData(string $key): ?array |
175 | 175 | { |
176 | 176 | // n'existe pas, retourne null |
177 | - if (! array_key_exists($key, $this->expirations)) { |
|
177 | + if (!array_key_exists($key, $this->expirations)) { |
|
178 | 178 | return null; |
179 | 179 | } |
180 | 180 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | // ================================= FONCTIONS UTIILITAIRES ESSENTIELLES ================================= // |
30 | 30 | |
31 | -if (! function_exists('env')) { |
|
31 | +if (!function_exists('env')) { |
|
32 | 32 | /** |
33 | 33 | * Obtient une variable d'environnement à partir des sources disponibles et fournit une émulation |
34 | 34 | * pour les variables d'environnement non prises en charge ou incohérentes |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | } |
46 | 46 | |
47 | -if (! function_exists('helper')) { |
|
47 | +if (!function_exists('helper')) { |
|
48 | 48 | /** |
49 | 49 | * Charge un fichier d'aide en mémoire. Prend en charge les assistants d'espace de noms, |
50 | 50 | * à la fois dans et hors du répertoire 'helpers' d'un répertoire à espace de noms. |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | -if (! function_exists('model')) { |
|
63 | +if (!function_exists('model')) { |
|
64 | 64 | /** |
65 | 65 | * Simple maniere d'obtenir un modele. |
66 | 66 | * |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | * |
71 | 71 | * @return T |
72 | 72 | */ |
73 | - function model(array|string $name, ?ConnectionInterface &$conn = null) |
|
73 | + function model(array|string $name, ?ConnectionInterface&$conn = null) |
|
74 | 74 | { |
75 | 75 | return Load::model($name, $conn); |
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | -if (! function_exists('service')) { |
|
79 | +if (!function_exists('service')) { |
|
80 | 80 | /** |
81 | 81 | * Permet un accès plus propre au fichier de configuration des services. |
82 | 82 | * Renvoie toujours une instance SHARED de la classe, donc l'appel de la fonction plusieurs fois renvera toujours la même instance. |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
100 | -if (! function_exists('single_service')) { |
|
100 | +if (!function_exists('single_service')) { |
|
101 | 101 | /** |
102 | 102 | * Autoriser l'accès propre à un service. |
103 | 103 | * Renvoie toujours une nouvelle instance de la classe. |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
120 | -if (! function_exists('show404')) { |
|
120 | +if (!function_exists('show404')) { |
|
121 | 121 | /** |
122 | 122 | * Afficher une page 404 introuvable dans le navigateur |
123 | 123 | */ |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | } |
128 | 128 | } |
129 | 129 | |
130 | -if (! function_exists('command')) { |
|
130 | +if (!function_exists('command')) { |
|
131 | 131 | /** |
132 | 132 | * Exécute une seule commande. |
133 | 133 | * Entrée attendue dans une seule chaîne comme celle qui serait utilisée sur la ligne de commande elle-même : |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | } |
191 | 191 | } |
192 | 192 | |
193 | -if (! function_exists('config')) { |
|
193 | +if (!function_exists('config')) { |
|
194 | 194 | /** |
195 | 195 | * GET/SET App config |
196 | 196 | * |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | } |
219 | 219 | } |
220 | 220 | |
221 | -if (! function_exists('logger')) { |
|
221 | +if (!function_exists('logger')) { |
|
222 | 222 | /** |
223 | 223 | * Une méthode de commodité pour les événements de journalisation via le système Log. |
224 | 224 | * |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | } |
249 | 249 | } |
250 | 250 | |
251 | -if (! function_exists('cache')) { |
|
251 | +if (!function_exists('cache')) { |
|
252 | 252 | /** |
253 | 253 | * Une méthode pratique qui donne accès au cache |
254 | 254 | * objet. Si aucun paramètre n'est fourni, renverra l'objet, |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | } |
279 | 279 | } |
280 | 280 | |
281 | -if (! function_exists('cookie')) { |
|
281 | +if (!function_exists('cookie')) { |
|
282 | 282 | /** |
283 | 283 | * Une méthode pratique qui donne accès à l'objet cookie. |
284 | 284 | * Si aucun paramètre n'est fourni, renverra l'objet, |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | } |
307 | 307 | } |
308 | 308 | |
309 | -if (! function_exists('session')) { |
|
309 | +if (!function_exists('session')) { |
|
310 | 310 | /** |
311 | 311 | * Une méthode pratique pour accéder à l'instance de session, ou un élément qui a été défini dans la session. |
312 | 312 | * |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | |
332 | 332 | // =========================== FONCTIONS DE PREVENTION D'ATTAQUE =========================== // |
333 | 333 | |
334 | -if (! function_exists('esc')) { |
|
334 | +if (!function_exists('esc')) { |
|
335 | 335 | /** |
336 | 336 | * Effectue un simple échappement automatique des données pour des raisons de sécurité. |
337 | 337 | * Pourrait envisager de rendre cela plus complexe à une date ultérieure. |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | } |
359 | 359 | } |
360 | 360 | |
361 | -if (! function_exists('h')) { |
|
361 | +if (!function_exists('h')) { |
|
362 | 362 | /** |
363 | 363 | * Méthode pratique pour htmlspecialchars. |
364 | 364 | * |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | } |
378 | 378 | } |
379 | 379 | |
380 | -if (! function_exists('purify')) { |
|
380 | +if (!function_exists('purify')) { |
|
381 | 381 | /** |
382 | 382 | * Purifiez l'entrée à l'aide de la classe autonome HTMLPurifier. |
383 | 383 | * Utilisez facilement plusieurs configurations de purificateur. |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | } |
394 | 394 | } |
395 | 395 | |
396 | -if (! function_exists('remove_invisible_characters')) { |
|
396 | +if (!function_exists('remove_invisible_characters')) { |
|
397 | 397 | /** |
398 | 398 | * Supprimer les caractères invisibles |
399 | 399 | * |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | } |
407 | 407 | } |
408 | 408 | |
409 | -if (! function_exists('stringify_attributes')) { |
|
409 | +if (!function_exists('stringify_attributes')) { |
|
410 | 410 | /** |
411 | 411 | * Chaîner les attributs à utiliser dans les balises HTML. |
412 | 412 | * |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | |
421 | 421 | // ================================= FONCTIONS DE FORMULAIRE ================================= // |
422 | 422 | |
423 | -if (! function_exists('csrf_token')) { |
|
423 | +if (!function_exists('csrf_token')) { |
|
424 | 424 | /** |
425 | 425 | * Renvoie la valeur de hachage actuelle pour la protection CSRF. |
426 | 426 | * Peut être utilisé dans les vues lors de la construction manuelle d'input cachées, ou utilisé dans les variables javascript pour l'utilisation de l'API. |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | } |
432 | 432 | } |
433 | 433 | |
434 | -if (! function_exists('csrf_field')) { |
|
434 | +if (!function_exists('csrf_field')) { |
|
435 | 435 | /** |
436 | 436 | * Génère un champ input caché à utiliser dans les formulaires générés manuellement. |
437 | 437 | */ |
@@ -439,11 +439,11 @@ discard block |
||
439 | 439 | { |
440 | 440 | $name = config('security.csrf_token_name', '_token'); |
441 | 441 | |
442 | - return '<input type="hidden"' . (! empty($id) ? ' id="' . esc($id, 'attr') . '"' : '') . ' name="' . $name . '" value="' . csrf_token() . '">'; |
|
442 | + return '<input type="hidden"' . (!empty($id) ? ' id="' . esc($id, 'attr') . '"' : '') . ' name="' . $name . '" value="' . csrf_token() . '">'; |
|
443 | 443 | } |
444 | 444 | } |
445 | 445 | |
446 | -if (! function_exists('csrf_meta')) { |
|
446 | +if (!function_exists('csrf_meta')) { |
|
447 | 447 | /** |
448 | 448 | * Génère une balise méta à utiliser dans les appels javascript. |
449 | 449 | */ |
@@ -451,17 +451,17 @@ discard block |
||
451 | 451 | { |
452 | 452 | $name = config('security.csrf_header_name', 'X-CSRF-TOKEN'); |
453 | 453 | |
454 | - return '<meta' . (! empty($id) ? ' id="' . esc($id, 'attr') . '"' : '') . ' name="' . $name . '" content="' . csrf_token() . '">'; |
|
454 | + return '<meta' . (!empty($id) ? ' id="' . esc($id, 'attr') . '"' : '') . ' name="' . $name . '" content="' . csrf_token() . '">'; |
|
455 | 455 | } |
456 | 456 | } |
457 | 457 | |
458 | -if (! function_exists('method_field')) { |
|
458 | +if (!function_exists('method_field')) { |
|
459 | 459 | /** |
460 | 460 | * Générer un champ de formulaire pour usurper le verbe HTTP utilisé par les formulaires. |
461 | 461 | */ |
462 | 462 | function method_field(string $method): string |
463 | 463 | { |
464 | - if (! in_array($method = strtoupper($method), ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
464 | + if (!in_array($method = strtoupper($method), ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
465 | 465 | throw new InvalidArgumentException(sprintf('Methode %s invalide', $method)); |
466 | 466 | } |
467 | 467 | |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | |
472 | 472 | // ================================= FONCTIONS D'ENVIRONNEMENT D'EXECUTION ================================= // |
473 | 473 | |
474 | -if (! function_exists('environment')) { |
|
474 | +if (!function_exists('environment')) { |
|
475 | 475 | /** |
476 | 476 | * Renvoi l'environnement d'execution actuel ou determine si on est dans un environnement specifie |
477 | 477 | * |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | } |
510 | 510 | } |
511 | 511 | |
512 | -if (! function_exists('on_dev')) { |
|
512 | +if (!function_exists('on_dev')) { |
|
513 | 513 | /** |
514 | 514 | * Testez pour voir si nous sommes dans un environnement de développement. |
515 | 515 | */ |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | } |
524 | 524 | } |
525 | 525 | |
526 | -if (! function_exists('on_prod')) { |
|
526 | +if (!function_exists('on_prod')) { |
|
527 | 527 | /** |
528 | 528 | * Testez pour voir si nous sommes dans un environnement de production. |
529 | 529 | */ |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | } |
538 | 538 | } |
539 | 539 | |
540 | -if (! function_exists('on_test')) { |
|
540 | +if (!function_exists('on_test')) { |
|
541 | 541 | /** |
542 | 542 | * Testez pour voir si nous sommes dans un environnement de test |
543 | 543 | */ |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | } |
548 | 548 | } |
549 | 549 | |
550 | -if (! function_exists('is_cli')) { |
|
550 | +if (!function_exists('is_cli')) { |
|
551 | 551 | /** |
552 | 552 | * Testez pour voir si une demande a été faite à partir de la ligne de commande. |
553 | 553 | */ |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | } |
558 | 558 | } |
559 | 559 | |
560 | -if (! function_exists('is_php')) { |
|
560 | +if (!function_exists('is_php')) { |
|
561 | 561 | /** |
562 | 562 | * Détermine si la version actuelle de PHP est égale ou supérieure à la valeur fournie. |
563 | 563 | */ |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | } |
568 | 568 | } |
569 | 569 | |
570 | -if (! function_exists('is_windows')) { |
|
570 | +if (!function_exists('is_windows')) { |
|
571 | 571 | /** |
572 | 572 | * Déterminez si l'environnement actuel est basé sur Windows. |
573 | 573 | */ |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | } |
578 | 578 | } |
579 | 579 | |
580 | -if (! function_exists('is_https')) { |
|
580 | +if (!function_exists('is_https')) { |
|
581 | 581 | /** |
582 | 582 | * Determines if the application is accessed via an encrypted * (HTTPS) connection. |
583 | 583 | */ |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | } |
588 | 588 | } |
589 | 589 | |
590 | -if (! function_exists('is_localfile')) { |
|
590 | +if (!function_exists('is_localfile')) { |
|
591 | 591 | /** |
592 | 592 | * Vérifiez si le fichier auquel vous souhaitez accéder est un fichier local de votre application ou non |
593 | 593 | */ |
@@ -597,11 +597,11 @@ discard block |
||
597 | 597 | return true; |
598 | 598 | } |
599 | 599 | |
600 | - return ! preg_match('#^(https?://)#i', $name); |
|
600 | + return !preg_match('#^(https?://)#i', $name); |
|
601 | 601 | } |
602 | 602 | } |
603 | 603 | |
604 | -if (! function_exists('is_online')) { |
|
604 | +if (!function_exists('is_online')) { |
|
605 | 605 | /** |
606 | 606 | * Tester si l'application s'exécute en local ou en ligne. |
607 | 607 | */ |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | } |
612 | 612 | } |
613 | 613 | |
614 | -if (! function_exists('is_connected')) { |
|
614 | +if (!function_exists('is_connected')) { |
|
615 | 615 | /** |
616 | 616 | * Verifie si l'utilisateur a une connexion internet active. |
617 | 617 | */ |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | } |
622 | 622 | } |
623 | 623 | |
624 | -if (! function_exists('is_ajax_request')) { |
|
624 | +if (!function_exists('is_ajax_request')) { |
|
625 | 625 | /** |
626 | 626 | * Testez pour voir si une requête contient l'en-tête HTTP_X_REQUESTED_WITH. |
627 | 627 | */ |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | } |
632 | 632 | } |
633 | 633 | |
634 | -if (! function_exists('redirection')) { |
|
634 | +if (!function_exists('redirection')) { |
|
635 | 635 | /** |
636 | 636 | * Redirige l'utilisateur |
637 | 637 | */ |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | } |
646 | 646 | } |
647 | 647 | |
648 | -if (! function_exists('redirect')) { |
|
648 | +if (!function_exists('redirect')) { |
|
649 | 649 | /** |
650 | 650 | * Méthode pratique qui fonctionne avec la $request globale actuelle et |
651 | 651 | * l'instance $router à rediriger à l'aide de routes nommées et le routage inversé |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | { |
660 | 660 | $redirection = Services::redirection(); |
661 | 661 | |
662 | - if (! empty($uri)) { |
|
662 | + if (!empty($uri)) { |
|
663 | 663 | return $redirection->route($uri); |
664 | 664 | } |
665 | 665 | |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | } |
668 | 668 | } |
669 | 669 | |
670 | -if (! function_exists('back')) { |
|
670 | +if (!function_exists('back')) { |
|
671 | 671 | /** |
672 | 672 | * Retourne a la page precedente |
673 | 673 | * |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | } |
680 | 680 | } |
681 | 681 | |
682 | -if (! function_exists('link_to')) { |
|
682 | +if (!function_exists('link_to')) { |
|
683 | 683 | /** |
684 | 684 | * Étant donné une chaîne de contrôleur/méthode et tous les paramètres, |
685 | 685 | * tentera de créer l'URL relative à la route correspondante. |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | } |
700 | 700 | } |
701 | 701 | |
702 | -if (! function_exists('clean_path')) { |
|
702 | +if (!function_exists('clean_path')) { |
|
703 | 703 | /** |
704 | 704 | * Une méthode pratique pour nettoyer les chemins pour |
705 | 705 | * une sortie plus belle. Utile pour les exceptions |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | } |
732 | 732 | } |
733 | 733 | |
734 | -if (! function_exists('old')) { |
|
734 | +if (!function_exists('old')) { |
|
735 | 735 | /** |
736 | 736 | * Fournit l'accès à "entrée ancienne" qui a été définie dans la session lors d'un redirect()-withInput(). |
737 | 737 | * |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | function old(string $key, $default = null, $escape = 'html') |
745 | 745 | { |
746 | 746 | // Assurez-vous de charger la session |
747 | - if (session_status() === PHP_SESSION_NONE && ! on_test()) { |
|
747 | + if (session_status() === PHP_SESSION_NONE && !on_test()) { |
|
748 | 748 | session(); // @codeCoverageIgnore |
749 | 749 | } |
750 | 750 | |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | |
760 | 760 | // ================================= FONCTIONS DE DEBOGAGE ================================= // |
761 | 761 | |
762 | -if (! function_exists('deprecationWarning')) { |
|
762 | +if (!function_exists('deprecationWarning')) { |
|
763 | 763 | /** |
764 | 764 | * Méthode d'assistance pour générer des avertissements d'obsolescence |
765 | 765 | * |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | } |
776 | 776 | } |
777 | 777 | |
778 | -if (! function_exists('pr')) { |
|
778 | +if (!function_exists('pr')) { |
|
779 | 779 | /** |
780 | 780 | * print_r() convenience function. |
781 | 781 | * |
@@ -797,7 +797,7 @@ discard block |
||
797 | 797 | } |
798 | 798 | } |
799 | 799 | |
800 | -if (! function_exists('pj')) { |
|
800 | +if (!function_exists('pj')) { |
|
801 | 801 | /** |
802 | 802 | * json pretty print convenience function. |
803 | 803 | * |
@@ -818,7 +818,7 @@ discard block |
||
818 | 818 | } |
819 | 819 | } |
820 | 820 | |
821 | -if (! function_exists('trigger_warning')) { |
|
821 | +if (!function_exists('trigger_warning')) { |
|
822 | 822 | /** |
823 | 823 | * Déclenche un E_USER_WARNING. |
824 | 824 | */ |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | |
831 | 831 | // ================================= FONCTIONS DIVERSES ================================= // |
832 | 832 | |
833 | -if (! function_exists('force_https')) { |
|
833 | +if (!function_exists('force_https')) { |
|
834 | 834 | /** |
835 | 835 | * Utilisé pour forcer l'accès à une page via HTTPS. |
836 | 836 | * Utilise une redirection standard, plus définira l'en-tête HSTS |
@@ -857,7 +857,7 @@ discard block |
||
857 | 857 | |
858 | 858 | // Si la session est active, nous devons régénérer |
859 | 859 | // l'ID de session pour des raisons de sécurité. |
860 | - if (! on_test() && session_status() === PHP_SESSION_ACTIVE) { |
|
860 | + if (!on_test() && session_status() === PHP_SESSION_ACTIVE) { |
|
861 | 861 | Services::session()->regenerate(); // @codeCoverageIgnore |
862 | 862 | } |
863 | 863 | |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | } |
874 | 874 | } |
875 | 875 | |
876 | -if (! function_exists('get_type_name')) { |
|
876 | +if (!function_exists('get_type_name')) { |
|
877 | 877 | /** |
878 | 878 | * Renvoie la classe d'objets ou le type var de ce n'est pas un objet |
879 | 879 | * |
@@ -887,7 +887,7 @@ discard block |
||
887 | 887 | } |
888 | 888 | } |
889 | 889 | |
890 | -if (! function_exists('ip_address')) { |
|
890 | +if (!function_exists('ip_address')) { |
|
891 | 891 | /** |
892 | 892 | * Renvoie l'adresse IP de l'utilisateur actuel |
893 | 893 | */ |
@@ -897,7 +897,7 @@ discard block |
||
897 | 897 | } |
898 | 898 | } |
899 | 899 | |
900 | -if (! function_exists('is_really_writable')) { |
|
900 | +if (!function_exists('is_really_writable')) { |
|
901 | 901 | /** |
902 | 902 | * Tests d'inscriptibilité des fichiers |
903 | 903 | */ |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | } |
908 | 908 | } |
909 | 909 | |
910 | -if (! function_exists('lang')) { |
|
910 | +if (!function_exists('lang')) { |
|
911 | 911 | /** |
912 | 912 | * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater |
913 | 913 | * le résultat avec le MessageFormatter de l'extension intl. |
@@ -918,7 +918,7 @@ discard block |
||
918 | 918 | } |
919 | 919 | } |
920 | 920 | |
921 | -if (! function_exists('__')) { |
|
921 | +if (!function_exists('__')) { |
|
922 | 922 | /** |
923 | 923 | * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater |
924 | 924 | * le résultat avec le MessageFormatter de l'extension intl. |
@@ -931,7 +931,7 @@ discard block |
||
931 | 931 | } |
932 | 932 | } |
933 | 933 | |
934 | -if (! function_exists('namespace_split')) { |
|
934 | +if (!function_exists('namespace_split')) { |
|
935 | 935 | /** |
936 | 936 | * Séparez l'espace de noms du nom de classe. |
937 | 937 | * |
@@ -952,7 +952,7 @@ discard block |
||
952 | 952 | } |
953 | 953 | } |
954 | 954 | |
955 | -if (! function_exists('view_exist')) { |
|
955 | +if (!function_exists('view_exist')) { |
|
956 | 956 | /** |
957 | 957 | * Verifie si un fichier de vue existe. Utile pour limiter les failles include |
958 | 958 | */ |
@@ -962,7 +962,7 @@ discard block |
||
962 | 962 | } |
963 | 963 | } |
964 | 964 | |
965 | -if (! function_exists('view')) { |
|
965 | +if (!function_exists('view')) { |
|
966 | 966 | /** |
967 | 967 | * Saisit la classe compatible avec le RendererInterface et lui demande d'effectuer le rendu de la vue spécifiée. |
968 | 968 | * Fournit simplement une méthode de commodité qui peut être utilisée dans les contrôleurs, les bibliothèques et les routes sous forme de closure. |
@@ -977,7 +977,7 @@ discard block |
||
977 | 977 | } |
978 | 978 | } |
979 | 979 | |
980 | -if (! function_exists('component')) { |
|
980 | +if (!function_exists('component')) { |
|
981 | 981 | /** |
982 | 982 | * Les composants de vue sont utilisées dans les vues pour insérer des morceaux de HTML qui sont gérés par d'autres classes. |
983 | 983 | * |
@@ -993,7 +993,7 @@ discard block |
||
993 | 993 | } |
994 | 994 | } |
995 | 995 | |
996 | -if (! function_exists('flash')) { |
|
996 | +if (!function_exists('flash')) { |
|
997 | 997 | /** |
998 | 998 | * Fournisseur d'acces rapide a la classe PHP Flash |
999 | 999 | * |
@@ -1025,7 +1025,7 @@ discard block |
||
1025 | 1025 | }*/ |
1026 | 1026 | } |
1027 | 1027 | |
1028 | -if (! function_exists('geo_ip')) { |
|
1028 | +if (!function_exists('geo_ip')) { |
|
1029 | 1029 | /** |
1030 | 1030 | * Recuperation des coordonnees (pays, ville, etc) d'un utilisateur en fonction de son ip |
1031 | 1031 | */ |
@@ -1035,7 +1035,7 @@ discard block |
||
1035 | 1035 | } |
1036 | 1036 | } |
1037 | 1037 | |
1038 | -if (! function_exists('to_stream')) { |
|
1038 | +if (!function_exists('to_stream')) { |
|
1039 | 1039 | /** |
1040 | 1040 | * Créez un nouveau flux basé sur le type d'entrée. |
1041 | 1041 | * |
@@ -1056,7 +1056,7 @@ discard block |
||
1056 | 1056 | } |
1057 | 1057 | } |
1058 | 1058 | |
1059 | -if (! function_exists('value')) { |
|
1059 | +if (!function_exists('value')) { |
|
1060 | 1060 | /** |
1061 | 1061 | * Renvoie la valeur par défaut de la valeur donnée. |
1062 | 1062 | */ |
@@ -1066,7 +1066,7 @@ discard block |
||
1066 | 1066 | } |
1067 | 1067 | } |
1068 | 1068 | |
1069 | -if (! function_exists('collect')) { |
|
1069 | +if (!function_exists('collect')) { |
|
1070 | 1070 | /** |
1071 | 1071 | * Créez une collection à partir de la valeur donnée. |
1072 | 1072 | */ |
@@ -1076,7 +1076,7 @@ discard block |
||
1076 | 1076 | } |
1077 | 1077 | } |
1078 | 1078 | |
1079 | -if (! function_exists('with')) { |
|
1079 | +if (!function_exists('with')) { |
|
1080 | 1080 | /** |
1081 | 1081 | * Renvoie la valeur donnée, éventuellement transmise via le rappel donné. |
1082 | 1082 | * |
@@ -1088,7 +1088,7 @@ discard block |
||
1088 | 1088 | } |
1089 | 1089 | } |
1090 | 1090 | |
1091 | -if (! function_exists('tap')) { |
|
1091 | +if (!function_exists('tap')) { |
|
1092 | 1092 | /** |
1093 | 1093 | * Appelez la Closure donnée avec cette instance puis renvoyez l'instance. |
1094 | 1094 | */ |
@@ -1098,7 +1098,7 @@ discard block |
||
1098 | 1098 | } |
1099 | 1099 | } |
1100 | 1100 | |
1101 | -if (! function_exists('last')) { |
|
1101 | +if (!function_exists('last')) { |
|
1102 | 1102 | /** |
1103 | 1103 | * Recupere le dernier element d'un tableau |
1104 | 1104 | * |
@@ -1114,7 +1114,7 @@ discard block |
||
1114 | 1114 | } |
1115 | 1115 | } |
1116 | 1116 | |
1117 | -if (! function_exists('invade')) { |
|
1117 | +if (!function_exists('invade')) { |
|
1118 | 1118 | /** |
1119 | 1119 | * Cette classe offre une fonction d'invasion qui vous permettra de lire / écrire des propriétés privées d'un objet. |
1120 | 1120 | * Il vous permettra également de définir, obtenir et appeler des méthodes privées. |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $instance->initialize(Services::request(), Services::response(), Services::logger()); |
82 | 82 | } |
83 | 83 | |
84 | - if (! method_exists($instance, $method)) { |
|
84 | + if (!method_exists($instance, $method)) { |
|
85 | 85 | throw ViewException::invalidComponentMethod($class, $method); |
86 | 86 | } |
87 | 87 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $library = str_replace('::', ':', $library); |
148 | 148 | |
149 | 149 | // Les composants contrôlées peuvent être appelées avec le seul nom de la classe, c'est pourquoi il faut ajouter une méthode par défaut |
150 | - if (! str_contains($library, ':')) { |
|
150 | + if (!str_contains($library, ':')) { |
|
151 | 151 | $library .= ':render'; |
152 | 152 | } |
153 | 153 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | } |
178 | 178 | } |
179 | 179 | |
180 | - if (! is_object($object)) { |
|
180 | + if (!is_object($object)) { |
|
181 | 181 | throw ViewException::invalidComponentClass($class); |
182 | 182 | } |
183 | 183 | |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | |
273 | 273 | $output = $instance->{$method}(); |
274 | 274 | } elseif (($paramCount === 1) |
275 | - && ((! array_key_exists($refParams[0]->name, $params)) |
|
275 | + && ((!array_key_exists($refParams[0]->name, $params)) |
|
276 | 276 | || (array_key_exists($refParams[0]->name, $params) |
277 | 277 | && count($params) !== 1)) |
278 | 278 | ) { |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | } |
290 | 290 | |
291 | 291 | foreach (array_keys($params) as $key) { |
292 | - if (! isset($methodParams[$key])) { |
|
292 | + if (!isset($methodParams[$key])) { |
|
293 | 293 | throw ViewException::invalidComponentParameter($key); |
294 | 294 | } |
295 | 295 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | collect(static::$data) |
80 | 80 | ->map( |
81 | 81 | static fn ($items) => collect($items) |
82 | - ->map(static function ($value) { |
|
82 | + ->map(static function($value) { |
|
83 | 83 | if (is_array($value)) { |
84 | 84 | return [$value]; |
85 | 85 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | ->all(); |
95 | 95 | })->flatten(1) |
96 | 96 | ) |
97 | - ->sortBy(static function ($data, $key) { |
|
97 | + ->sortBy(static function($data, $key) { |
|
98 | 98 | $index = array_search($key, ['Environnement', 'Cache', 'Gestionnaires'], true); |
99 | 99 | |
100 | 100 | return $index === false ? 99 : $index; |
@@ -118,14 +118,14 @@ discard block |
||
118 | 118 | */ |
119 | 119 | protected function displayDetail(Collection $data): void |
120 | 120 | { |
121 | - $data->each(function ($data, $section) { |
|
121 | + $data->each(function($data, $section) { |
|
122 | 122 | $this->newLine(); |
123 | 123 | |
124 | 124 | $this->justify($section, '', ['first' => ['fg' => Color::GREEN]]); |
125 | 125 | |
126 | - $data->pipe(static fn ($data) => $section !== 'Environnement' ? $data->sort() : $data)->each(function ($detail) { |
|
126 | + $data->pipe(static fn ($data) => $section !== 'Environnement' ? $data->sort() : $data)->each(function($detail) { |
|
127 | 127 | [$label, $value] = $detail; |
128 | - if (! in_array($label, static::$displayed, true)) { |
|
128 | + if (!in_array($label, static::$displayed, true)) { |
|
129 | 129 | $this->justify($label, value($value, false)); |
130 | 130 | static::$displayed[] = $label; |
131 | 131 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | protected function displayJson(Collection $data): void |
140 | 140 | { |
141 | - $output = $data->flatMap(function ($data, $section) { |
|
141 | + $output = $data->flatMap(function($data, $section) { |
|
142 | 142 | return [ |
143 | 143 | (string) Text::of($section)->snake() => $data->mapWithKeys(fn ($item, $key) => [ |
144 | 144 | $this->toSearchKeyword($item[0]) => value($item[1], true), |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | |
182 | 182 | static::addToSection('Gestionnaires', static fn () => array_filter([ |
183 | 183 | 'Cache' => config('cache.handler'), |
184 | - 'Logs' => static function ($json) { |
|
184 | + 'Logs' => static function($json) { |
|
185 | 185 | $handlers = []; |
186 | 186 | |
187 | 187 | foreach (config('log.handlers') as $k => $v) { |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | */ |
255 | 255 | public static function format(mixed $value, ?Closure $console = null, ?Closure $json = null) |
256 | 256 | { |
257 | - return static function ($isJson) use ($value, $console, $json) { |
|
257 | + return static function($isJson) use ($value, $console, $json) { |
|
258 | 258 | if ($isJson === true && $json instanceof Closure) { |
259 | 259 | return value($json, $value); |
260 | 260 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | $file = $this->viewPath . $view; |
99 | 99 | |
100 | - if (! is_file($file)) { |
|
100 | + if (!is_file($file)) { |
|
101 | 101 | $fileOrig = $file; |
102 | 102 | $file = ($this->locator ?: Services::locator())->locateFile($view, 'Views'); |
103 | 103 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | public function setData(array $data = [], ?string $context = null): static |
173 | 173 | { |
174 | - if (! empty($context)) { |
|
174 | + if (!empty($context)) { |
|
175 | 175 | foreach ($data as $key => &$value) { |
176 | 176 | if (is_array($value)) { |
177 | 177 | foreach ($value as &$obj) { |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | foreach ($matches as $match) { |
282 | 282 | // Loop over each piece of $data, replacing |
283 | 283 | // its contents so that we know what to replace in parse() |
284 | - $str = ''; // holds the new contents for this tag pair. |
|
284 | + $str = ''; // holds the new contents for this tag pair. |
|
285 | 285 | |
286 | 286 | foreach ($data as $row) { |
287 | 287 | // Objects that have a `toArray()` method should be |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | if (is_array($val)) { |
304 | 304 | $pair = $this->parsePair($key, $val, $match[1]); |
305 | 305 | |
306 | - if (! empty($pair)) { |
|
306 | + if (!empty($pair)) { |
|
307 | 307 | $pairs[array_keys($pair)[0]] = true; |
308 | 308 | |
309 | 309 | $temp = array_merge($temp, $pair); |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | |
324 | 324 | // Now replace our placeholders with the new content. |
325 | 325 | foreach ($temp as $pattern => $content) { |
326 | - $out = $this->replaceSingle($pattern, $content, $out, ! isset($pairs[$pattern])); |
|
326 | + $out = $this->replaceSingle($pattern, $content, $out, !isset($pairs[$pattern])); |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | $str .= $out; |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | protected function replaceSingle(array|string $pattern, string $content, string $template, bool $escape = false): string |
482 | 482 | { |
483 | 483 | // Replace the content in the template |
484 | - return preg_replace_callback($pattern, function ($matches) use ($content, $escape) { |
|
484 | + return preg_replace_callback($pattern, function($matches) use ($content, $escape) { |
|
485 | 485 | // Check for {! !} syntax to not escape this one. |
486 | 486 | if ( |
487 | 487 | str_starts_with($matches[0], $this->leftDelimiter . '!') |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | |
504 | 504 | // Our regex earlier will leave all chained values on a single line |
505 | 505 | // so we need to break them apart so we can apply them all. |
506 | - $filters = ! empty($matches[1]) ? explode('|', $matches[1]) : []; |
|
506 | + $filters = !empty($matches[1]) ? explode('|', $matches[1]) : []; |
|
507 | 507 | |
508 | 508 | if ($escape && empty($filters) && ($context = $this->shouldAddEscaping($orig))) { |
509 | 509 | $filters[] = "esc({$context})"; |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | } |
532 | 532 | } |
533 | 533 | // No pipes, then we know we need to escape |
534 | - elseif (! str_contains($key, '|')) { |
|
534 | + elseif (!str_contains($key, '|')) { |
|
535 | 535 | $escape = 'html'; |
536 | 536 | } |
537 | 537 | // If there's a `noescape` then we're definitely false. |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | $escape = false; |
540 | 540 | } |
541 | 541 | // If no `esc` filter is found, then we'll need to add one. |
542 | - elseif (! preg_match('/\s+esc/u', $key)) { |
|
542 | + elseif (!preg_match('/\s+esc/u', $key)) { |
|
543 | 543 | $escape = 'html'; |
544 | 544 | } |
545 | 545 | |
@@ -558,10 +558,10 @@ discard block |
||
558 | 558 | preg_match('/\([\w<>=\/\\\,:.\-\s\+]+\)/u', $filter, $param); |
559 | 559 | |
560 | 560 | // Remove the () and spaces to we have just the parameter left |
561 | - $param = ! empty($param) ? trim($param[0], '() ') : null; |
|
561 | + $param = !empty($param) ? trim($param[0], '() ') : null; |
|
562 | 562 | |
563 | 563 | // Params can be separated by commas to allow multiple parameters for the filter |
564 | - if (! empty($param)) { |
|
564 | + if (!empty($param)) { |
|
565 | 565 | $param = explode(',', $param); |
566 | 566 | |
567 | 567 | // Clean it up |
@@ -573,10 +573,10 @@ discard block |
||
573 | 573 | } |
574 | 574 | |
575 | 575 | // Get our filter name |
576 | - $filter = ! empty($param) ? trim(strtolower(substr($filter, 0, strpos($filter, '(')))) : trim($filter); |
|
576 | + $filter = !empty($param) ? trim(strtolower(substr($filter, 0, strpos($filter, '(')))) : trim($filter); |
|
577 | 577 | |
578 | 578 | $this->config['filters'] ??= []; |
579 | - if (! array_key_exists($filter, $this->config['filters'])) { |
|
579 | + if (!array_key_exists($filter, $this->config['filters'])) { |
|
580 | 580 | continue; |
581 | 581 | } |
582 | 582 | |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | * $matches[1] = all parameters string in opening tag |
614 | 614 | * $matches[2] = content between the tags to send to the plugin. |
615 | 615 | */ |
616 | - if (! preg_match_all($pattern, $template, $matches, PREG_SET_ORDER)) { |
|
616 | + if (!preg_match_all($pattern, $template, $matches, PREG_SET_ORDER)) { |
|
617 | 617 | continue; |
618 | 618 | } |
619 | 619 |
@@ -67,7 +67,7 @@ |
||
67 | 67 | return $base . $fullname; |
68 | 68 | } |
69 | 69 | |
70 | - if ($plugin || ! static::_classExistsInBase($fullname, 'BlitzPHP')) { |
|
70 | + if ($plugin || !static::_classExistsInBase($fullname, 'BlitzPHP')) { |
|
71 | 71 | return null; |
72 | 72 | } |
73 | 73 |