Completed
Push — master ( 1c3045...113bf8 )
by Neomerx
12:22
created
src/Routing/Traits/HasRequestFactoryTrait.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
     }
57 57
 
58 58
     /**
59
-     * @return callable
59
+     * @return string[]
60 60
      *
61 61
      * @SuppressWarnings(PHPMD.StaticAccess)
62 62
      */
Please login to merge, or discard this patch.
src/Routing/NestedGroup.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
     {
47 47
         $parentGroupName = $this->parentGroup()->getName();
48 48
         $selfName        = parent::getName();
49
-        $result          = $parentGroupName !== null || $selfName !== null ? $parentGroupName . $selfName : null;
49
+        $result          = $parentGroupName !== null || $selfName !== null ? $parentGroupName.$selfName : null;
50 50
 
51 51
         return $result;
52 52
     }
Please login to merge, or discard this patch.
src/Application/Application.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     }
148 148
 
149 149
     /**
150
-     * @return callable
150
+     * @return string[]
151 151
      */
152 152
     public static function getDefaultRequestFactory(): callable
153 153
     {
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
     /**
215 215
      * @param LimoncelloContainerInterface $container
216
-     * @param callable[]|null              $globalConfigurators
216
+     * @param callable[]              $globalConfigurators
217 217
      * @param callable[]|null              $routeConfigurators
218 218
      *
219 219
      * @return void
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
              */
241 241
             public function __construct(Throwable $throwable, int $status)
242 242
             {
243
-                parent::__construct((string)$throwable, $status);
243
+                parent::__construct((string) $throwable, $status);
244 244
                 $this->setThrowable($throwable);
245 245
             }
246 246
         };
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
                 ['array', PsrContainerInterface::class, ServerRequestInterface::class],
324 324
                 ResponseInterface::class
325 325
             ),
326
-            'Handler method should have signature ' .
326
+            'Handler method should have signature '.
327 327
             '`public static methodName(array, PsrContainerInterface, ServerRequestInterface): ResponseInterface`'
328 328
         );
329 329
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
         array $handlerParams,
365 365
         PsrContainerInterface $container
366 366
     ): Closure {
367
-        return function (ServerRequestInterface $request = null) use (
367
+        return function(ServerRequestInterface $request = null) use (
368 368
             $handler,
369 369
             $handlerParams,
370 370
             $container
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
                 [SapiInterface::class, PsrContainerInterface::class],
397 397
                 ServerRequestInterface::class
398 398
             ),
399
-            'Factory method should have signature ' .
399
+            'Factory method should have signature '.
400 400
             '`public static methodName(SapiInterface, PsrContainerInterface): ServerRequestInterface`'
401 401
         );
402 402
 
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
     private function createMethodNotAllowedTerminalHandler(array $allowedMethods): Closure
414 414
     {
415 415
         // 405 Method Not Allowed
416
-        return function () use ($allowedMethods): ResponseInterface {
416
+        return function() use ($allowedMethods): ResponseInterface {
417 417
             return $this->createEmptyResponse(405, ['Accept' => implode(',', $allowedMethods)]);
418 418
         };
419 419
     }
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
     private function createNotFoundTerminalHandler(): Closure
425 425
     {
426 426
         // 404 Not Found
427
-        return function (): ResponseInterface {
427
+        return function(): ResponseInterface {
428 428
             return $this->createEmptyResponse(404);
429 429
         };
430 430
     }
@@ -470,11 +470,11 @@  discard block
 block discarded – undo
470 470
                 [ServerRequestInterface::class, Closure::class, PsrContainerInterface::class],
471 471
                 ResponseInterface::class
472 472
             ),
473
-            'Middleware method should have signature ' .
473
+            'Middleware method should have signature '.
474 474
             '`public static methodName(ServerRequestInterface, Closure, PsrContainerInterface): ResponseInterface`'
475 475
         );
476 476
 
477
-        return function (ServerRequestInterface $request) use ($next, $middleware, $container): ResponseInterface {
477
+        return function(ServerRequestInterface $request) use ($next, $middleware, $container): ResponseInterface {
478 478
             return call_user_func($middleware, $request, $next, $container);
479 479
         };
480 480
     }
Please login to merge, or discard this patch.
src/Reflection/CheckCallableTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             $methodParam = $methodParams[$index];
85 85
             if (is_string($parameter) === true) {
86 86
                 $methodType = $methodParam->getType();
87
-                if ($methodType === null || (string)$methodType !== $parameter) {
87
+                if ($methodType === null || (string) $methodType !== $parameter) {
88 88
                     $isParamOk = false;
89 89
                 }
90 90
             } elseif ($parameter === null) {
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $isReturnTypeOk = true;
113 113
         if ($areAllParamsOk === true && $returnType !== null) {
114 114
             $methodRetType  = $reflectionMethod->getReturnType();
115
-            $isReturnTypeOk = $methodRetType !== null && (string)$methodRetType === $returnType;
115
+            $isReturnTypeOk = $methodRetType !== null && (string) $methodRetType === $returnType;
116 116
         }
117 117
 
118 118
         $isOk = $areAllParamsOk === true && $isReturnTypeOk === true;
Please login to merge, or discard this patch.
src/Routing/Traits/UriTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
     protected function normalizeUri(string $uri, bool $trailingSlash): string
31 31
     {
32 32
         // add starting '/' and cut ending '/' if necessary
33
-        $uri = strlen($uri) > 0 && $uri[0] === '/' ? $uri : '/' . $uri;
33
+        $uri = strlen($uri) > 0 && $uri[0] === '/' ? $uri : '/'.$uri;
34 34
         $prefixLen = strlen($uri);
35 35
         $uri = $prefixLen > 1 && substr($uri, -1) === '/' ? substr($uri, 0, $prefixLen - 1) : $uri;
36 36
 
37 37
         // feature: trailing slashes are possible when asked
38
-        $uri = $trailingSlash === true && substr($uri, -1) !== '/' ? $uri . '/' : $uri;
38
+        $uri = $trailingSlash === true && substr($uri, -1) !== '/' ? $uri.'/' : $uri;
39 39
 
40 40
         return $uri;
41 41
     }
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 
54 54
         // only one has '/'
55 55
         if ($fEndsWithSlash xor $sStartsWithSlash) {
56
-            return $uri1 . $uri2;
56
+            return $uri1.$uri2;
57 57
         }
58 58
 
59 59
         // either both have '/' nor both don't have
60 60
 
61
-        $result = $fEndsWithSlash === true ? $uri1 . substr($uri2, 1) : $uri1 . '/' . $uri2;
61
+        $result = $fEndsWithSlash === true ? $uri1.substr($uri2, 1) : $uri1.'/'.$uri2;
62 62
 
63 63
         return $result;
64 64
     }
Please login to merge, or discard this patch.
src/Routing/Traits/CallableTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
      */
27 27
     protected function getCallableToCacheMessage(): string
28 28
     {
29
-        return 'Value either not callable or cannot be cached or do not meet method signature requirements. ' .
29
+        return 'Value either not callable or cannot be cached or do not meet method signature requirements. '.
30 30
             'Use callable in form of \'ClassName::methodName\' or [ClassName::class, \'methodName\'].';
31 31
     }
32 32
 }
Please login to merge, or discard this patch.
src/Routing/Route.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@
 block discarded – undo
184 184
      */
185 185
     public function getName(): ?string
186 186
     {
187
-        $result = $this->name !== null ? (string)$this->getGroup()->getName() . $this->name : null;
187
+        $result = $this->name !== null ? (string) $this->getGroup()->getName().$this->name : null;
188 188
 
189 189
         return $result;
190 190
     }
Please login to merge, or discard this patch.
src/Routing/Router.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     {
154 154
         $this->checkRoutesLoaded();
155 155
 
156
-        list(, , $namedRouteUriPaths) = $this->cachedRoutes;
156
+        list(,, $namedRouteUriPaths) = $this->cachedRoutes;
157 157
 
158 158
         $result = array_key_exists($routeName, $namedRouteUriPaths) === true ? $namedRouteUriPaths[$routeName] : null;
159 159
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     ): string {
172 172
         $path = $this->getUriPath($routeName);
173 173
         $path = $path === null ? $path : $this->replacePlaceholders($path, $placeholders);
174
-        $url  = empty($queryParams) === true ? "$hostUri$path" : "$hostUri$path?" . http_build_query($queryParams);
174
+        $url  = empty($queryParams) === true ? "$hostUri$path" : "$hostUri$path?".http_build_query($queryParams);
175 175
 
176 176
         return $url;
177 177
     }
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
                     break;
232 232
                 case '}':
233 233
                     $result .= array_key_exists($curPlaceholder, $placeholders) === true ?
234
-                        $placeholders[$curPlaceholder] : '{' . $curPlaceholder . '}';
234
+                        $placeholders[$curPlaceholder] : '{'.$curPlaceholder.'}';
235 235
 
236 236
                     $inPlaceholder     = false;
237 237
                     $curPlaceholder    = null;
Please login to merge, or discard this patch.