Test Failed
Branch main (64d39c)
by Dimitri
02:51
created
src/Helpers/common.php 1 patch
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 // ================================= FONCTIONS UTIILITAIRES ESSENTIELLES ================================= //
29 29
 
30
-if (! function_exists('env')) {
30
+if (!function_exists('env')) {
31 31
     /**
32 32
      * Obtient une variable d'environnement à partir des sources disponibles et fournit une émulation
33 33
      * pour les variables d'environnement non prises en charge ou incohérentes
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     }
44 44
 }
45 45
 
46
-if (! function_exists('helper')) {
46
+if (!function_exists('helper')) {
47 47
     /**
48 48
      * Charge un fichier d'aide en mémoire. Prend en charge les assistants d'espace de noms,
49 49
      * à la fois dans et hors du répertoire 'helpers' d'un répertoire à espace de noms.
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     }
60 60
 }
61 61
 
62
-if (! function_exists('model')) {
62
+if (!function_exists('model')) {
63 63
     /**
64 64
      * Simple maniere d'obtenir un modele.
65 65
      *
@@ -69,13 +69,13 @@  discard block
 block discarded – undo
69 69
      *
70 70
      * @return T
71 71
      */
72
-    function model(array|string $name, ?ConnectionInterface &$conn = null)
72
+    function model(array|string $name, ?ConnectionInterface&$conn = null)
73 73
     {
74 74
         return Load::model($name, $conn);
75 75
     }
76 76
 }
77 77
 
78
-if (! function_exists('service')) {
78
+if (!function_exists('service')) {
79 79
     /**
80 80
      * Permet un accès plus propre au fichier de configuration des services.
81 81
      * Renvoie toujours une instance SHARED de la classe, donc l'appel de la fonction plusieurs fois renvera toujours la même instance.
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     }
97 97
 }
98 98
 
99
-if (! function_exists('single_service')) {
99
+if (!function_exists('single_service')) {
100 100
     /**
101 101
      * Autoriser l'accès propre à un service.
102 102
      * Renvoie toujours une nouvelle instance de la classe.
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     }
117 117
 }
118 118
 
119
-if (! function_exists('show404')) {
119
+if (!function_exists('show404')) {
120 120
     /**
121 121
      * Afficher une page 404 introuvable dans le navigateur
122 122
      */
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     }
127 127
 }
128 128
 
129
-if (! function_exists('command')) {
129
+if (!function_exists('command')) {
130 130
     /**
131 131
      * Exécute une seule commande.
132 132
      * Entrée attendue dans une seule chaîne comme celle qui serait utilisée sur la ligne de commande elle-même :
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
     }
189 189
 }
190 190
 
191
-if (! function_exists('config')) {
191
+if (!function_exists('config')) {
192 192
     /**
193 193
      * GET/SET App config
194 194
      *
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     }
217 217
 }
218 218
 
219
-if (! function_exists('logger')) {
219
+if (!function_exists('logger')) {
220 220
     /**
221 221
      * Une méthode de commodité pour les événements de journalisation via le système Log.
222 222
      *
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
     }
247 247
 }
248 248
 
249
-if (! function_exists('cache')) {
249
+if (!function_exists('cache')) {
250 250
     /**
251 251
      * Une méthode pratique qui donne accès au cache
252 252
      * objet. Si aucun paramètre n'est fourni, renverra l'objet,
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
     }
277 277
 }
278 278
 
279
-if (! function_exists('cookie')) {
279
+if (!function_exists('cookie')) {
280 280
     /**
281 281
      * Une méthode pratique qui donne accès à l'objet cookie.
282 282
      * Si aucun paramètre n'est fourni, renverra l'objet,
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
     }
305 305
 }
306 306
 
307
-if (! function_exists('session')) {
307
+if (!function_exists('session')) {
308 308
     /**
309 309
      * Une méthode pratique pour accéder à l'instance de session, ou un élément qui a été défini dans la session.
310 310
      *
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 
330 330
 // =========================== FONCTIONS DE PREVENTION D'ATTAQUE =========================== //
331 331
 
332
-if (! function_exists('esc')) {
332
+if (!function_exists('esc')) {
333 333
     /**
334 334
      * Effectue un simple échappement automatique des données pour des raisons de sécurité.
335 335
      * Pourrait envisager de rendre cela plus complexe à une date ultérieure.
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
     }
357 357
 }
358 358
 
359
-if (! function_exists('h')) {
359
+if (!function_exists('h')) {
360 360
     /**
361 361
      * Méthode pratique pour htmlspecialchars.
362 362
      *
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
     }
376 376
 }
377 377
 
378
-if (! function_exists('purify')) {
378
+if (!function_exists('purify')) {
379 379
     /**
380 380
      * Purifiez l'entrée à l'aide de la classe autonome HTMLPurifier.
381 381
      * Utilisez facilement plusieurs configurations de purificateur.
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
     }
392 392
 }
393 393
 
394
-if (! function_exists('remove_invisible_characters')) {
394
+if (!function_exists('remove_invisible_characters')) {
395 395
     /**
396 396
      * Supprimer les caractères invisibles
397 397
      *
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
     }
405 405
 }
406 406
 
407
-if (! function_exists('stringify_attributes')) {
407
+if (!function_exists('stringify_attributes')) {
408 408
     /**
409 409
      * Chaîner les attributs à utiliser dans les balises HTML.
410 410
      *
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 
419 419
 // ================================= FONCTIONS D'ENVIRONNEMENT D'EXECUTION ================================= //
420 420
 
421
-if (! function_exists('environment')) {
421
+if (!function_exists('environment')) {
422 422
     /**
423 423
      * Renvoi l'environnement d'execution actuel ou determine si on est dans un environnement specifie
424 424
      *
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
     }
457 457
 }
458 458
 
459
-if (! function_exists('on_dev')) {
459
+if (!function_exists('on_dev')) {
460 460
     /**
461 461
      * Testez pour voir si nous sommes dans un environnement de développement.
462 462
      */
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
     }
471 471
 }
472 472
 
473
-if (! function_exists('on_prod')) {
473
+if (!function_exists('on_prod')) {
474 474
     /**
475 475
      * Testez pour voir si nous sommes dans un environnement de production.
476 476
      */
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
     }
485 485
 }
486 486
 
487
-if (! function_exists('on_test')) {
487
+if (!function_exists('on_test')) {
488 488
     /**
489 489
      * Testez pour voir si nous sommes dans un environnement de test
490 490
      */
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
     }
495 495
 }
496 496
 
497
-if (! function_exists('is_cli')) {
497
+if (!function_exists('is_cli')) {
498 498
     /**
499 499
      * Testez pour voir si une demande a été faite à partir de la ligne de commande.
500 500
      */
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
     }
505 505
 }
506 506
 
507
-if (! function_exists('is_php')) {
507
+if (!function_exists('is_php')) {
508 508
     /**
509 509
      * Détermine si la version actuelle de PHP est égale ou supérieure à la valeur fournie.
510 510
      */
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
     }
515 515
 }
516 516
 
517
-if (! function_exists('is_windows')) {
517
+if (!function_exists('is_windows')) {
518 518
     /**
519 519
      * Déterminez si l'environnement actuel est basé sur Windows.
520 520
      */
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
     }
525 525
 }
526 526
 
527
-if (! function_exists('is_https')) {
527
+if (!function_exists('is_https')) {
528 528
     /**
529 529
      * Determines if the application is accessed via an encrypted * (HTTPS) connection.
530 530
      */
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
     }
535 535
 }
536 536
 
537
-if (! function_exists('is_localfile')) {
537
+if (!function_exists('is_localfile')) {
538 538
     /**
539 539
      * Vérifiez si le fichier auquel vous souhaitez accéder est un fichier local de votre application ou non
540 540
      */
@@ -544,11 +544,11 @@  discard block
 block discarded – undo
544 544
             return true;
545 545
         }
546 546
 
547
-        return ! preg_match('#^(https?://)#i', $name);
547
+        return !preg_match('#^(https?://)#i', $name);
548 548
     }
549 549
 }
550 550
 
551
-if (! function_exists('is_online')) {
551
+if (!function_exists('is_online')) {
552 552
     /**
553 553
      * Tester si l'application s'exécute en local ou en ligne.
554 554
      */
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
     }
559 559
 }
560 560
 
561
-if (! function_exists('is_connected')) {
561
+if (!function_exists('is_connected')) {
562 562
     /**
563 563
      * Verifie si l'utilisateur a une connexion internet active.
564 564
      */
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
     }
569 569
 }
570 570
 
571
-if (! function_exists('is_ajax_request')) {
571
+if (!function_exists('is_ajax_request')) {
572 572
     /**
573 573
      * Testez pour voir si une requête contient l'en-tête HTTP_X_REQUESTED_WITH.
574 574
      */
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
     }
579 579
 }
580 580
 
581
-if (! function_exists('redirection')) {
581
+if (!function_exists('redirection')) {
582 582
     /**
583 583
      * Redirige l'utilisateur
584 584
      */
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
     }
593 593
 }
594 594
 
595
-if (! function_exists('redirect')) {
595
+if (!function_exists('redirect')) {
596 596
     /**
597 597
      * Méthode pratique qui fonctionne avec la $request globale actuelle et
598 598
      * l'instance $router à rediriger à l'aide de routes nommées et le routage inversé
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
     {
607 607
         $redirection = Services::redirection();
608 608
 
609
-        if (! empty($uri)) {
609
+        if (!empty($uri)) {
610 610
             return $redirection->route($uri);
611 611
         }
612 612
 
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
     }
615 615
 }
616 616
 
617
-if (! function_exists('back')) {
617
+if (!function_exists('back')) {
618 618
     /**
619 619
      * Retourne a la page precedente
620 620
      *
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
     }
627 627
 }
628 628
 
629
-if (! function_exists('link_to')) {
629
+if (!function_exists('link_to')) {
630 630
     /**
631 631
      * Étant donné une chaîne de contrôleur/méthode et tous les paramètres,
632 632
      * tentera de créer l'URL relative à la route correspondante.
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
     }
647 647
 }
648 648
 
649
-if (! function_exists('clean_path')) {
649
+if (!function_exists('clean_path')) {
650 650
     /**
651 651
      * Une méthode pratique pour nettoyer les chemins pour
652 652
      * une sortie plus belle. Utile pour les exceptions
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
     }
679 679
 }
680 680
 
681
-if (! function_exists('old')) {
681
+if (!function_exists('old')) {
682 682
     /**
683 683
      * Fournit l'accès à "entrée ancienne" qui a été définie dans la session lors d'un redirect()-withInput().
684 684
      *
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
     function old(string $key, $default = null, $escape = 'html')
692 692
     {
693 693
         // Assurez-vous de charger la session
694
-        if (session_status() === PHP_SESSION_NONE && ! on_test()) {
694
+        if (session_status() === PHP_SESSION_NONE && !on_test()) {
695 695
             session(); // @codeCoverageIgnore
696 696
         }
697 697
 
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 
707 707
 // ================================= FONCTIONS DE DEBOGAGE ================================= //
708 708
 
709
-if (! function_exists('deprecationWarning')) {
709
+if (!function_exists('deprecationWarning')) {
710 710
     /**
711 711
      * Méthode d'assistance pour générer des avertissements d'obsolescence
712 712
      *
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
     }
723 723
 }
724 724
 
725
-if (! function_exists('pr')) {
725
+if (!function_exists('pr')) {
726 726
     /**
727 727
      * print_r() convenience function.
728 728
      *
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
     }
745 745
 }
746 746
 
747
-if (! function_exists('pj')) {
747
+if (!function_exists('pj')) {
748 748
     /**
749 749
      * json pretty print convenience function.
750 750
      *
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
     }
766 766
 }
767 767
 
768
-if (! function_exists('trigger_warning')) {
768
+if (!function_exists('trigger_warning')) {
769 769
     /**
770 770
      * Déclenche un E_USER_WARNING.
771 771
      */
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
 
778 778
 // ================================= FONCTIONS DIVERSES ================================= //
779 779
 
780
-if (! function_exists('force_https')) {
780
+if (!function_exists('force_https')) {
781 781
     /**
782 782
      * Utilisé pour forcer l'accès à une page via HTTPS.
783 783
      * Utilise une redirection standard, plus définira l'en-tête HSTS
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
     }
836 836
 }
837 837
 
838
-if (! function_exists('get_type_name')) {
838
+if (!function_exists('get_type_name')) {
839 839
     /**
840 840
      * Renvoie la classe d'objets ou le type var de ce n'est pas un objet
841 841
      *
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
     }
850 850
 }
851 851
 
852
-if (! function_exists('ip_address')) {
852
+if (!function_exists('ip_address')) {
853 853
     /**
854 854
      * Renvoie l'adresse IP de l'utilisateur actuel
855 855
      */
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
     }
860 860
 }
861 861
 
862
-if (! function_exists('is_really_writable')) {
862
+if (!function_exists('is_really_writable')) {
863 863
     /**
864 864
      * Tests d'inscriptibilité des fichiers
865 865
      */
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
     }
870 870
 }
871 871
 
872
-if (! function_exists('lang')) {
872
+if (!function_exists('lang')) {
873 873
     /**
874 874
      * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater
875 875
      * le résultat avec le MessageFormatter de l'extension intl.
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
     }
881 881
 }
882 882
 
883
-if (! function_exists('__')) {
883
+if (!function_exists('__')) {
884 884
     /**
885 885
      * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater
886 886
      * le résultat avec le MessageFormatter de l'extension intl.
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
     }
894 894
 }
895 895
 
896
-if (! function_exists('namespace_split')) {
896
+if (!function_exists('namespace_split')) {
897 897
     /**
898 898
      * Séparez l'espace de noms du nom de classe.
899 899
      *
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
     }
915 915
 }
916 916
 
917
-if (! function_exists('view_exist')) {
917
+if (!function_exists('view_exist')) {
918 918
     /**
919 919
      * Verifie si un fichier de vue existe. Utile pour limiter les failles include
920 920
      */
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
     }
929 929
 }
930 930
 
931
-if (! function_exists('view')) {
931
+if (!function_exists('view')) {
932 932
     /**
933 933
      * Charge une vue
934 934
      *
@@ -944,7 +944,7 @@  discard block
 block discarded – undo
944 944
     }
945 945
 }
946 946
 
947
-if (! function_exists('flash')) {
947
+if (!function_exists('flash')) {
948 948
     /**
949 949
      * Fournisseur d'acces rapide a la classe PHP Flash
950 950
      *
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
     }*/
977 977
 }
978 978
 
979
-if (! function_exists('geo_ip')) {
979
+if (!function_exists('geo_ip')) {
980 980
     /**
981 981
      * Recuperation des coordonnees (pays, ville, etc) d'un utilisateur en fonction de son ip
982 982
      */
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
     }
987 987
 }
988 988
 
989
-if (! function_exists('to_stream')) {
989
+if (!function_exists('to_stream')) {
990 990
     /**
991 991
      * Créez un nouveau flux basé sur le type d'entrée.
992 992
      *
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
     }
1008 1008
 }
1009 1009
 
1010
-if (! function_exists('value')) {
1010
+if (!function_exists('value')) {
1011 1011
     /**
1012 1012
      * Renvoie la valeur par défaut de la valeur donnée.
1013 1013
      */
@@ -1017,7 +1017,7 @@  discard block
 block discarded – undo
1017 1017
     }
1018 1018
 }
1019 1019
 
1020
-if (! function_exists('collect')) {
1020
+if (!function_exists('collect')) {
1021 1021
     /**
1022 1022
      * Créez une collection à partir de la valeur donnée.
1023 1023
      */
@@ -1027,7 +1027,7 @@  discard block
 block discarded – undo
1027 1027
     }
1028 1028
 }
1029 1029
 
1030
-if (! function_exists('with')) {
1030
+if (!function_exists('with')) {
1031 1031
     /**
1032 1032
      * Renvoie la valeur donnée, éventuellement transmise via le rappel donné.
1033 1033
      *
@@ -1039,7 +1039,7 @@  discard block
 block discarded – undo
1039 1039
     }
1040 1040
 }
1041 1041
 
1042
-if (! function_exists('tap')) {
1042
+if (!function_exists('tap')) {
1043 1043
     /**
1044 1044
      * Appelez la Closure donnée avec cette instance puis renvoyez l'instance.
1045 1045
      */
@@ -1049,7 +1049,7 @@  discard block
 block discarded – undo
1049 1049
     }
1050 1050
 }
1051 1051
 
1052
-if (! function_exists('last')) {
1052
+if (!function_exists('last')) {
1053 1053
     /**
1054 1054
      * Recupere le dernier element d'un tableau
1055 1055
      */
@@ -1059,7 +1059,7 @@  discard block
 block discarded – undo
1059 1059
     }
1060 1060
 }
1061 1061
 
1062
-if (! function_exists('invade')) {
1062
+if (!function_exists('invade')) {
1063 1063
     /**
1064 1064
      * Cette classe offre une fonction d'invasion qui vous permettra de lire / écrire des propriétés privées d'un objet.
1065 1065
      * Il vous permettra également de définir, obtenir et appeler des méthodes privées.
Please login to merge, or discard this patch.
src/Cli/Commands/Generators/Views/middleware.tpl.php 1 patch
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,10 +11,13 @@  discard block
 block discarded – undo
11 11
 use Psr\Http\Server\RequestHandlerInterface;
12 12
 
13 13
 class {class} extends BaseMiddleware implements MiddlewareInterface
14
-<?php else: ?>
14
+<?php else {
15
+    : ?>
15 16
 
16 17
 class {class} extends BaseMiddleware
17
-<?php endif; ?>
18
+<?php endif;
19
+}
20
+?>
18 21
 {
19 22
     /**
20 23
      * Traitez une demande de serveur entrante.
@@ -26,16 +29,22 @@  discard block
 block discarded – undo
26 29
      */
27 30
 <?php if ($standard === 'psr15'): ?>
28 31
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
29
-<?php else: ?>
32
+<?php else {
33
+    : ?>
30 34
     public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface
31
-<?php endif; ?>
35
+<?php endif;
36
+}
37
+?>
32 38
     {
33 39
         //
34 40
 
35 41
 <?php if ($standard === 'psr15'): ?>
36 42
         return $handler->handle($request);
37
-<?php else: ?>
43
+<?php else {
44
+    : ?>
38 45
         return $next($request, $response);
39
-<?php endif; ?>
46
+<?php endif;
47
+}
48
+?>
40 49
     }
41 50
 }
Please login to merge, or discard this patch.
src/Cli/Commands/Generators/Middleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
     {
79 79
         $standard = $this->option('standard', 'psr15');
80 80
 
81
-        if (! in_array($standard, ['psr15', 'psr7'], true)) {
81
+        if (!in_array($standard, ['psr15', 'psr7'], true)) {
82 82
             // @codeCoverageIgnoreStart
83 83
             $standard = $this->choice(lang('CLI.generator.middlewareStandard'), ['psr15', 'psr7'], 'psr15');
84 84
             $this->eol();
Please login to merge, or discard this patch.
src/Middlewares/BaseMiddleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         $this->arguments = array_merge($this->arguments, $arguments);
39 39
 
40 40
         foreach ($this->arguments as $argument => $value) {
41
-            if (! is_string($argument)) {
41
+            if (!is_string($argument)) {
42 42
                 continue;
43 43
             }
44 44
 
Please login to merge, or discard this patch.