Passed
Push — main ( bfe281...a04a11 )
by Dimitri
11:19
created
src/Router/Dispatcher.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             $controller = $routes->getDefaultController();
179 179
         }
180 180
 
181
-		if (! $fullName && is_string($controller)) {
181
+		if (!$fullName && is_string($controller)) {
182 182
             $controller = str_replace($routes->getDefaultNamespace(), '', $controller);
183 183
         }
184 184
 
@@ -323,14 +323,14 @@  discard block
 block discarded – undo
323 323
             return;
324 324
         }
325 325
 
326
-        if (is_cli() && ! on_test()) {
326
+        if (is_cli() && !on_test()) {
327 327
             // @codeCoverageIgnoreStart
328 328
             // $this->request = Services::clirequest($this->config);
329 329
             // @codeCoverageIgnoreEnd
330 330
         }
331 331
 
332 332
         $version = $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1';
333
-        if (! is_numeric($version)) {
333
+        if (!is_numeric($version)) {
334 334
             $version = substr($version, strpos($version, '/') + 1);
335 335
         }
336 336
 
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
         // Supposons le succès jusqu'à preuve du contraire.
350 350
         $this->response = Services::response()->withStatus(200);
351 351
 
352
-        if (! is_cli() || on_test()) {
352
+        if (!is_cli() || on_test()) {
353 353
         }
354 354
 
355 355
         $this->response = $this->response->withProtocolVersion($this->request->getProtocolVersion());
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
      */
464 464
     protected function determinePath(): string
465 465
     {
466
-        if (! empty($this->path)) {
466
+        if (!empty($this->path)) {
467 467
             return $this->path;
468 468
         }
469 469
 
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
         }
505 505
 
506 506
         // Essayez de charger automatiquement la classe
507
-        if (! class_exists($this->controller, true) || ($this->method[0] === '_' && $this->method !== '__invoke')) {
507
+        if (!class_exists($this->controller, true) || ($this->method[0] === '_' && $this->method !== '__invoke')) {
508 508
             throw PageNotFoundException::controllerNotFound($this->controller, $this->method);
509 509
         }
510 510
 
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
         echo $this->outputBufferingEnd();
598 598
         flush();
599 599
 
600
-        throw PageNotFoundException::pageNotFound(! on_prod() || is_cli() ? $e->getMessage() : '');
600
+        throw PageNotFoundException::pageNotFound(!on_prod() || is_cli() ? $e->getMessage() : '');
601 601
     }
602 602
 
603 603
     /**
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
     public function storePreviousURL($uri)
640 640
     {
641 641
         // Ignorer les requêtes CLI
642
-        if (is_cli() && ! on_test()) {
642
+        if (is_cli() && !on_test()) {
643 643
             return; // @codeCoverageIgnore
644 644
         }
645 645
 
@@ -761,11 +761,11 @@  discard block
 block discarded – undo
761 761
      */
762 762
     private function spoofRequestMethod(): callable
763 763
     {
764
-        return static function (ServerRequestInterface $request, ResponseInterface $response, callable $next) {
764
+        return static function(ServerRequestInterface $request, ResponseInterface $response, callable $next) {
765 765
             $post = $request->getParsedBody();
766 766
 
767 767
             // Ne fonctionne qu'avec les formulaires POST
768
-            if (strtoupper($request->getMethod()) === 'POST' && ! empty($post['_method'])) {
768
+            if (strtoupper($request->getMethod()) === 'POST' && !empty($post['_method'])) {
769 769
                 // Accepte seulement PUT, PATCH, DELETE
770 770
                 if (in_array(strtoupper($post['_method']), ['PUT', 'PATCH', 'DELETE'], true)) {
771 771
                     $request = $request->withMethod($post['_method']);
@@ -778,15 +778,15 @@  discard block
 block discarded – undo
778 778
 
779 779
     private function bootApp(): callable
780 780
     {
781
-        return function (ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface {
781
+        return function(ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface {
782 782
             try {
783 783
                 $returned = $this->startController($request, $response);
784 784
 
785 785
                 // Closure controller has run in startController().
786
-                if (! is_callable($this->controller)) {
786
+                if (!is_callable($this->controller)) {
787 787
                     $controller = $this->createController($request, $response);
788 788
 
789
-                    if (! method_exists($controller, '_remap') && ! is_callable([$controller, $this->method], false)) {
789
+                    if (!method_exists($controller, '_remap') && !is_callable([$controller, $this->method], false)) {
790 790
                         throw PageNotFoundException::methodNotFound($this->method);
791 791
                     }
792 792
 
Please login to merge, or discard this patch.