Test Failed
Pull Request — master (#16)
by Divine Niiquaye
02:47
created
src/Middlewares/PathMiddleware.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
         $requestUri = $request->getUri();
61 61
         $response = $handler->handle($request);
62
-        $requestPath = \preg_replace($prefixRegex, $requestUri->getPath()[-1], $requestUri->getPath());
62
+        $requestPath = \preg_replace($prefixRegex, $requestUri->getPath()[- 1], $requestUri->getPath());
63 63
 
64 64
         // Determine the response code should keep HTTP request method ...
65 65
         $statusCode = $this->keepRequestMethod ? ($this->permanent ? 308 : 307) : ($this->permanent ? 301 : 302);
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
         $route = $request->getAttribute(Route::class);
72 72
 
73 73
         if ($route instanceof Route) {
74
-            $routeEndTail = Route::URL_PREFIX_SLASHES[$route->get('path')[-1]] ?? null;
75
-            $requestEndTail = Route::URL_PREFIX_SLASHES[$requestPath[-1]] ?? null;
74
+            $routeEndTail = Route::URL_PREFIX_SLASHES[$route->get('path')[- 1]] ?? null;
75
+            $requestEndTail = Route::URL_PREFIX_SLASHES[$requestPath[- 1]] ?? null;
76 76
 
77 77
             if ($routeEndTail === $requestEndTail) {
78 78
                 return $response;
Please login to merge, or discard this patch.
src/Route.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -206,7 +206,7 @@
 block discarded – undo
206 206
     public function namespace(string $namespace): self
207 207
     {
208 208
         if ('' !== $namespace) {
209
-            if ('\\' === $namespace[-1]) {
209
+            if ('\\' === $namespace[- 1]) {
210 210
                 throw new InvalidControllerException(\sprintf('Namespace "%s" provided for routes must not end with a "\\".', $namespace));
211 211
             }
212 212
 
Please login to merge, or discard this patch.
src/RouteMatcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
     {
86 86
         $requestPath = $uri->getPath();
87 87
 
88
-        if ('/' !== $requestPath && isset(Route::URL_PREFIX_SLASHES[$requestPath[-1]])) {
88
+        if ('/' !== $requestPath && isset(Route::URL_PREFIX_SLASHES[$requestPath[- 1]])) {
89 89
             $uri = $uri->withPath($requestPath = \substr($requestPath, 0, -1));
90 90
         }
91 91
 
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
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         $routePath = \ltrim($route->get('path'), '/');
102 102
 
103 103
         // Strip supported browser prefix of $routePath ...
104
-        if (!empty($routePath) && isset(Route::URL_PREFIX_SLASHES[$routePath[-1]])) {
104
+        if (!empty($routePath) && isset(Route::URL_PREFIX_SLASHES[$routePath[- 1]])) {
105 105
             $routePath = \substr($routePath, 0, -1);
106 106
         }
107 107
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
                 $regex = \substr($regex, 2);
215 215
             }
216 216
 
217
-            if ('$' === $regex[-1]) {
217
+            if ('$' === $regex[- 1]) {
218 218
                 $regex = \substr($regex, 0, -1);
219 219
             } elseif (\strlen($regex) - 2 === \strpos($regex, '\\z')) {
220 220
                 $regex = \substr($regex, 0, -2);
Please login to merge, or discard this patch.
src/Traits/CastingTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -215,12 +215,12 @@
 block discarded – undo
215 215
             return $uri;
216 216
         }
217 217
 
218
-        if (isset(Route::URL_PREFIX_SLASHES[$prefix[-1]], Route::URL_PREFIX_SLASHES[$uri[0]])) {
218
+        if (isset(Route::URL_PREFIX_SLASHES[$prefix[- 1]], Route::URL_PREFIX_SLASHES[$uri[0]])) {
219 219
             return $prefix . \ltrim($uri, \implode('', Route::URL_PREFIX_SLASHES));
220 220
         }
221 221
 
222 222
         // browser supported slashes ...
223
-        $slashExist = Route::URL_PREFIX_SLASHES[$prefix[-1]] ?? Route::URL_PREFIX_SLASHES[$uri[0]] ?? null;
223
+        $slashExist = Route::URL_PREFIX_SLASHES[$prefix[- 1]] ?? Route::URL_PREFIX_SLASHES[$uri[0]] ?? null;
224 224
 
225 225
         if (null === $slashExist) {
226 226
             $prefix .= '/';
Please login to merge, or discard this patch.
src/Traits/GroupingTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
             $this->processRouteMaps($route, $this->compiler->compile($route), $routeId);
125 125
 
126
-            ++$routeId;
126
+            ++ $routeId;
127 127
         }
128 128
 
129 129
         $this->hasGroups = false;
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
             $name = $route->generateRouteName('');
157 157
 
158 158
             if (isset($unnamedRoutes[$name])) {
159
-                $name .= ('_' !== $name[-1] ? '_' : '') . ++$unnamedRoutes[$name];
159
+                $name .= ('_' !== $name[- 1] ? '_' : '') . ++$unnamedRoutes[$name];
160 160
             } else {
161 161
                 $unnamedRoutes[$name] = 0;
162 162
             }
Please login to merge, or discard this patch.