Test Failed
Push — main ( 88b8ff...27a594 )
by Dimitri
03:42
created
src/Http/MiddlewareQueue.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
      */
252 252
     public function seek(int $position): void
253 253
     {
254
-        if (! isset($this->queue[$position])) {
254
+        if (!isset($this->queue[$position])) {
255 255
             throw new OutOfBoundsException(sprintf('Invalid seek position (%s).', $position));
256 256
         }
257 257
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
      */
272 272
     public function current(): MiddlewareInterface
273 273
     {
274
-        if (! isset($this->queue[$this->position])) {
274
+        if (!isset($this->queue[$this->position])) {
275 275
             throw new OutOfBoundsException(sprintf('Position actuelle non valide (%s).', $this->position));
276 276
         }
277 277
 
@@ -343,8 +343,8 @@  discard block
 block discarded – undo
343 343
     public function resolveGroups()
344 344
     {
345 345
         foreach ($this->queue as $queue) {
346
-            if (is_string($queue) && ! empty($this->groups[$queue])) {
347
-                if (! is_array($this->groups[$queue])) {
346
+            if (is_string($queue) && !empty($this->groups[$queue])) {
347
+                if (!is_array($this->groups[$queue])) {
348 348
                     continue;
349 349
                 }
350 350
 
Please login to merge, or discard this patch.
src/Router/Dispatcher.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
             $controller = $routes->getDefaultController();
178 178
         }
179 179
 
180
-        if (! $fullName && is_string($controller)) {
180
+        if (!$fullName && is_string($controller)) {
181 181
             $controller = str_replace($routes->getDefaultNamespace(), '', $controller);
182 182
         }
183 183
 
@@ -300,14 +300,14 @@  discard block
 block discarded – undo
300 300
             return;
301 301
         }
302 302
 
303
-        if (is_cli() && ! on_test()) {
303
+        if (is_cli() && !on_test()) {
304 304
             // @codeCoverageIgnoreStart
305 305
             // $this->request = Services::clirequest($this->config);
306 306
             // @codeCoverageIgnoreEnd
307 307
         }
308 308
 
309 309
         $version = $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1';
310
-        if (! is_numeric($version)) {
310
+        if (!is_numeric($version)) {
311 311
             $version = substr($version, strpos($version, '/') + 1);
312 312
         }
313 313
 
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
         // Supposons le succès jusqu'à preuve du contraire.
327 327
         $this->response = Services::response()->withStatus(200);
328 328
 
329
-        if (! is_cli() || on_test()) {
329
+        if (!is_cli() || on_test()) {
330 330
         }
331 331
 
332 332
         $this->response = $this->response->withProtocolVersion($this->request->getProtocolVersion());
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
         }
424 424
 
425 425
         // Essayez de charger automatiquement la classe
426
-        if (! class_exists($this->controller, true) || ($this->method[0] === '_' && $this->method !== '__invoke')) {
426
+        if (!class_exists($this->controller, true) || ($this->method[0] === '_' && $this->method !== '__invoke')) {
427 427
             throw PageNotFoundException::controllerNotFound($this->controller, $this->method);
428 428
         }
429 429
 
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 
513 513
         $this->outputBufferingEnd();
514 514
 
515
-        throw PageNotFoundException::pageNotFound(! on_prod() || is_cli() ? $e->getMessage() : '');
515
+        throw PageNotFoundException::pageNotFound(!on_prod() || is_cli() ? $e->getMessage() : '');
516 516
     }
517 517
 
518 518
     /**
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
     public function storePreviousURL($uri)
555 555
     {
556 556
         // Ignorer les requêtes CLI
557
-        if (is_cli() && ! on_test()) {
557
+        if (is_cli() && !on_test()) {
558 558
             return; // @codeCoverageIgnore
559 559
         }
560 560
 
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
         }
565 565
 
566 566
         // Ignorer les reponses non-HTML
567
-        if (! str_contains($this->response->getHeaderLine('Content-Type'), 'text/html')) {
567
+        if (!str_contains($this->response->getHeaderLine('Content-Type'), 'text/html')) {
568 568
             return;
569 569
         }
570 570
 
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
      */
589 589
     protected function sendResponse()
590 590
     {
591
-        if (! $this->isAjaxRequest()) {
591
+        if (!$this->isAjaxRequest()) {
592 592
             $this->response = Services::toolbar()->prepare(
593 593
                 $this->getPerformanceStats(),
594 594
                 $this->request,
@@ -681,11 +681,11 @@  discard block
 block discarded – undo
681 681
      */
682 682
     private function spoofRequestMethod(): callable
683 683
     {
684
-        return static function (ServerRequestInterface $request, ResponseInterface $response, callable $next) {
684
+        return static function(ServerRequestInterface $request, ResponseInterface $response, callable $next) {
685 685
             $post = $request->getParsedBody();
686 686
 
687 687
             // Ne fonctionne qu'avec les formulaires POST
688
-            if ($request->getMethod() === 'POST' && ! empty($post['_method'])) {
688
+            if ($request->getMethod() === 'POST' && !empty($post['_method'])) {
689 689
                 // Accepte seulement PUT, PATCH, DELETE
690 690
                 if (in_array($post['_method'], ['PUT', 'PATCH', 'DELETE'], true)) {
691 691
                     $request = $request->withMethod($post['_method']);
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 
699 699
     private function bootApp(): callable
700 700
     {
701
-        return function (ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface {
701
+        return function(ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface {
702 702
             Services::set(Request::class, $request);
703 703
             Services::set(Response::class, $response);
704 704
 
@@ -706,10 +706,10 @@  discard block
 block discarded – undo
706 706
                 $returned = $this->startController();
707 707
 
708 708
                 // Les controleur sous forme de Closure sont executes dans startController().
709
-                if (! is_callable($this->controller)) {
709
+                if (!is_callable($this->controller)) {
710 710
                     $controller = $this->createController($request, $response);
711 711
 
712
-                    if (! method_exists($controller, '_remap') && ! is_callable([$controller, $this->method], false)) {
712
+                    if (!method_exists($controller, '_remap') && !is_callable([$controller, $this->method], false)) {
713 713
                         throw PageNotFoundException::methodNotFound($this->method);
714 714
                     }
715 715
 
Please login to merge, or discard this patch.