Test Failed
Pull Request — master (#16)
by Divine Niiquaye
02:34
created
src/Routes/Route.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -109,12 +109,12 @@
 block discarded – undo
109 109
             return $uri;
110 110
         }
111 111
 
112
-        if (isset(self::URL_PREFIX_SLASHES[$prefix[-1]], self::URL_PREFIX_SLASHES[$uri[0]])) {
112
+        if (isset(self::URL_PREFIX_SLASHES[$prefix[- 1]], self::URL_PREFIX_SLASHES[$uri[0]])) {
113 113
             return $prefix . \ltrim($uri, \implode('', self::URL_PREFIX_SLASHES));
114 114
         }
115 115
 
116 116
         // browser supported slashes ...
117
-        $slashExist = self::URL_PREFIX_SLASHES[$prefix[-1]] ?? self::URL_PREFIX_SLASHES[$uri[0]] ?? null;
117
+        $slashExist = self::URL_PREFIX_SLASHES[$prefix[- 1]] ?? self::URL_PREFIX_SLASHES[$uri[0]] ?? null;
118 118
 
119 119
         if (null === $slashExist) {
120 120
             $prefix .= '/';
Please login to merge, or discard this patch.
src/RouteCompiler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         $variables = []; // The vars found in path and hosts regex.
111 111
 
112 112
         // Strip supported browser prefix of $routePath ...
113
-        if (isset(BaseRoute::URL_PREFIX_SLASHES[@$routePath[-1]])) {
113
+        if (isset(BaseRoute::URL_PREFIX_SLASHES[@$routePath[- 1]])) {
114 114
             $routePath = \substr($routePath, 0, -1);
115 115
         }
116 116
 
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
         }
326 326
 
327 327
         return \implode('|', \array_map(
328
-            static function (string $segment) use ($name): string {
328
+            static function(string $segment) use ($name): string {
329 329
                 return self::sanitizeRequirement($name, $segment);
330 330
             },
331 331
             $segment
Please login to merge, or discard this patch.
src/RouteCollection.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -378,11 +378,11 @@  discard block
 block discarded – undo
378 378
     {
379 379
         $sortRegex = '#^[\w+' . \implode('\\', Routes\Route::URL_PREFIX_SLASHES) . ']+$#';
380 380
 
381
-        \usort($routes, static function (Routes\FastRoute $a, Routes\FastRoute $b) use ($sortRegex): int {
381
+        \usort($routes, static function(Routes\FastRoute $a, Routes\FastRoute $b) use ($sortRegex): int {
382 382
             $aRegex = \preg_match($sortRegex, $a->get('path'));
383 383
             $bRegex = \preg_match($sortRegex, $b->get('path'));
384 384
 
385
-            return $aRegex == $bRegex ? 0 : ($aRegex < $bRegex ? +1 : -1);
385
+            return $aRegex == $bRegex ? 0 : ($aRegex < $bRegex ? + 1 : -1);
386 386
         });
387 387
 
388 388
         return $routes;
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
                     $name = $route->generateRouteName('');
434 434
 
435 435
                     if (isset($unnamedRoutes[$name])) {
436
-                        $name .= ('_' !== $name[-1] ? '_' : '') . ++$unnamedRoutes[$name];
436
+                        $name .= ('_' !== $name[- 1] ? '_' : '') . ++$unnamedRoutes[$name];
437 437
                     } else {
438 438
                         $unnamedRoutes[$name] = 0;
439 439
                     }
Please login to merge, or discard this patch.
src/Middlewares/PathMiddleware.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,8 +65,8 @@
 block discarded – undo
65 65
             // Determine the response code should keep HTTP request method ...
66 66
             $statusCode = $this->keepRequestMethod ? ($this->permanent ? 308 : 307) : ($this->permanent ? 301 : 302);
67 67
 
68
-            $routeEndTail = BaseRoute::URL_PREFIX_SLASHES[$route->get('path')[-1]] ?? null;
69
-            $requestEndTail = BaseRoute::URL_PREFIX_SLASHES[$requestPath[-1]] ?? null;
68
+            $routeEndTail = BaseRoute::URL_PREFIX_SLASHES[$route->get('path')[- 1]] ?? null;
69
+            $requestEndTail = BaseRoute::URL_PREFIX_SLASHES[$requestPath[- 1]] ?? null;
70 70
 
71 71
             if ($routeEndTail === $requestEndTail) {
72 72
                 return $response;
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
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function setCollection(callable $routeDefinitionCallback): void
151 151
     {
152
-        $this->collection = static function () use ($routeDefinitionCallback): RouteCollection {
152
+        $this->collection = static function() use ($routeDefinitionCallback): RouteCollection {
153 153
             $routeDefinitionCallback($routeCollector = new RouteCollection());
154 154
 
155 155
             return $routeCollector;
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         }
179 179
 
180 180
         if ($collection instanceof RouteCollection) {
181
-            $collection = static function () use ($collection): RouteCollection {
181
+            $collection = static function() use ($collection): RouteCollection {
182 182
                 return $collection;
183 183
             };
184 184
         }
Please login to merge, or discard this patch.
src/RouteMatcher.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     {
97 97
         $requestPath = $uri->getPath();
98 98
 
99
-        if (\array_key_exists($requestPath[-1], BaseRoute::URL_PREFIX_SLASHES)) {
99
+        if (\array_key_exists($requestPath[- 1], BaseRoute::URL_PREFIX_SLASHES)) {
100 100
             $requestPath = \substr($requestPath, 0, -1) ?: '/';
101 101
         }
102 102
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         $routes = $this->routes;
159 159
 
160 160
         if (null !== $this->generatedRegex) {
161
-            \array_walk($routes, static function (&$data): void {
161
+            \array_walk($routes, static function(&$data): void {
162 162
                 $data = $data[0];
163 163
             });
164 164
         }
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         }
184 184
 
185 185
         foreach ($variables as $key => $value) {
186
-            $route->argument($key, $matches[++$matchVar] ?? $matches[$key] ?? $hostsVar[$key] ?? $value);
186
+            $route->argument($key, $matches[++ $matchVar] ?? $matches[$key] ?? $hostsVar[$key] ?? $value);
187 187
         }
188 188
 
189 189
         return $route->match($method, $uri);
Please login to merge, or discard this patch.
src/Routes/FastRoute.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
     public function namespace(string $namespace)
283 283
     {
284 284
         if ('' !== $namespace) {
285
-            if ('\\' === $namespace[-1]) {
285
+            if ('\\' === $namespace[- 1]) {
286 286
                 throw new InvalidControllerException(\sprintf('Namespace "%s" provided for routes must not end with a "\\".', $namespace));
287 287
             }
288 288
 
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
             throw new \InvalidArgumentException(\sprintf('Invalid call for "%s" in %s(\'%1$s\'), try any of [%s].', $name, __METHOD__, \implode(',', \array_keys(static::$getter))));
407 407
         }
408 408
 
409
-        if ('*' === $key[-1]) {
409
+        if ('*' === $key[- 1]) {
410 410
             return \array_unique($this->data[\substr($key, 0, -1)] ?? []);
411 411
         }
412 412
 
@@ -430,8 +430,8 @@  discard block
 block discarded – undo
430 430
      */
431 431
     public function getData(): array
432 432
     {
433
-        return \array_map(function (string $property) {
434
-            if ('*' === $property[-1]) {
433
+        return \array_map(function(string $property) {
434
+            if ('*' === $property[- 1]) {
435 435
                 $property = \substr($property, 0, -1);
436 436
             }
437 437
 
Please login to merge, or discard this patch.