Passed
Pull Request — master (#6)
by Florian
03:33
created
src/Parser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -221,7 +221,7 @@
 block discarded – undo
221 221
                 $opened--;
222 222
                 if ($opened === 0) {
223 223
                     $greedy = '?';
224
-                    if ($i < $len -1) {
224
+                    if ($i < $len - 1) {
225 225
                         if ($pattern[$i + 1] === '*' || $pattern[$i + 1] === '+') {
226 226
                             $greedy = $pattern[$i + 1];
227 227
                             $i++;
Please login to merge, or discard this patch.
src/Router.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
             $this->_pattern[$scheme][$host][$pattern] = $instance;
300 300
         }
301 301
 
302
-        $methods = $options['methods'] ? (array)$options['methods'] : [];
302
+        $methods = $options['methods'] ? (array) $options['methods'] : [];
303 303
 
304 304
         $instance->allow($methods);
305 305
 
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
             $request = $parsed + $request;
427 427
         }
428 428
 
429
-        $request['path'] = (ltrim((string)strtok($request['path'], '?'), '/'));
429
+        $request['path'] = (ltrim((string) strtok($request['path'], '?'), '/'));
430 430
         $request['method'] = strtoupper($request['method']);
431 431
 
432 432
         return $request;
Please login to merge, or discard this patch.
src/Route.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         $this->setMethods($config['methods']);
178 178
         $this->setScope($config['scope']);
179 179
         $this->setPattern($config['pattern']);
180
-        $this->setMiddleware((array)$config['middleware']);
180
+        $this->setMiddleware((array) $config['middleware']);
181 181
     }
182 182
 
183 183
     /**
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
      */
189 189
     public function setMiddleware(array $middleware)
190 190
     {
191
-        $this->_middleware = (array)$middleware;
191
+        $this->_middleware = (array) $middleware;
192 192
 
193 193
         return $this;
194 194
     }
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
      */
438 438
     public function setMethods($methods): self
439 439
     {
440
-        $methods = $methods ? (array)$methods : [];
440
+        $methods = $methods ? (array) $methods : [];
441 441
         $methods = array_map('strtoupper', $methods);
442 442
         $methods = array_fill_keys($methods, true);
443 443
 
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
      */
461 461
     public function allow($methods = [])
462 462
     {
463
-        $methods = $methods ? (array)$methods : [];
463
+        $methods = $methods ? (array) $methods : [];
464 464
         $methods = array_map('strtoupper', $methods);
465 465
         $methods = array_fill_keys($methods, true) + $this->_methods;
466 466
 
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
 
703 703
         $generator = $this->middleware();
704 704
 
705
-        $next = function () use ($request, $response, $generator, &$next) {
705
+        $next = function() use ($request, $response, $generator, &$next) {
706 706
             $handler = $generator->current();
707 707
             $generator->next();
708 708
 
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
             }
731 731
         }
732 732
 
733
-        yield function () {
733
+        yield function() {
734 734
             $handler = $this->getHandler();
735 735
             if ($handler === null) {
736 736
                 return null;
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
         ];
778 778
 
779 779
         $options = array_filter(
780
-            $options, function ($value) {
780
+            $options, function($value) {
781 781
                 return $value !== '*';
782 782
             }
783 783
         );
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
             if (isset($child['tokens'])) {
828 828
                 if ($child['repeat']) {
829 829
                     $name = $child['repeat'];
830
-                    $values = isset($params[$name]) && $params[$name] !== null ? (array)$params[$name] : [];
830
+                    $values = isset($params[$name]) && $params[$name] !== null ? (array) $params[$name] : [];
831 831
                     if (!$values && !$child['optional']) {
832 832
                         throw new RouterException("Missing parameters `'{$name}'` for route: `'{$this->name}#{$this->_pattern}'`.");
833 833
                     }
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
                 $parts = [];
855 855
             }
856 856
             foreach ($parts as $key => $value) {
857
-                $parts[$key] = rawurlencode((string)$value);
857
+                $parts[$key] = rawurlencode((string) $value);
858 858
             }
859 859
             $value = join('/', $parts);
860 860
 
Please login to merge, or discard this patch.