Completed
Branch master (8ae5a6)
by Neomerx
01:35
created
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   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -138,8 +138,7 @@  discard block
 block discarded – undo
138 138
             $this->addMiddlewareChain($handler, $container, $globalMiddleware, $routeMiddleware) : $handler;
139 139
 
140 140
         $request = $requestFactory === null && $hasMiddleware === false && $matchCode === RouterInterface::MATCH_FOUND ?
141
-            null :
142
-            $this->createRequest($this->sapi, $container, $requestFactory ?? static::getDefaultRequestFactory());
141
+            null : $this->createRequest($this->sapi, $container, $requestFactory ?? static::getDefaultRequestFactory());
143 142
 
144 143
         // Execute the pipeline by sending `Request` down all middleware (global then route's then
145 144
         // terminal handler in `Controller` and back) and then send `Response` to SAPI
@@ -206,7 +205,7 @@  discard block
 block discarded – undo
206 205
     /**
207 206
      * @return RouterInterface|null
208 207
      */
209
-    protected function getRouter(): ?RouterInterface
208
+    protected function getRouter(): ? RouterInterface
210 209
     {
211 210
         return $this->router;
212 211
     }
@@ -278,7 +277,7 @@  discard block
 block discarded – undo
278 277
                 ['array', PsrContainerInterface::class, ServerRequestInterface::class],
279 278
                 ResponseInterface::class
280 279
             ),
281
-            'Handler method should have signature ' .
280
+            'Handler method should have signature '.
282 281
             '`public static methodName(array, PsrContainerInterface, ServerRequestInterface): ResponseInterface`'
283 282
         );
284 283
 
@@ -326,7 +325,7 @@  discard block
 block discarded – undo
326 325
                 [SapiInterface::class, PsrContainerInterface::class],
327 326
                 ServerRequestInterface::class
328 327
             ),
329
-            'Factory method should have signature ' .
328
+            'Factory method should have signature '.
330 329
             '`public static methodName(SapiInterface, PsrContainerInterface): ServerRequestInterface`'
331 330
         );
332 331
 
@@ -347,7 +346,7 @@  discard block
 block discarded – undo
347 346
         array $handlerParams,
348 347
         PsrContainerInterface $container
349 348
     ): Closure {
350
-        return function (ServerRequestInterface $request = null) use ($handler, $handlerParams, $container) {
349
+        return function(ServerRequestInterface $request = null) use ($handler, $handlerParams, $container) {
351 350
             return $this->callHandler($handler, $handlerParams, $container, $request);
352 351
         };
353 352
     }
@@ -360,7 +359,7 @@  discard block
 block discarded – undo
360 359
     private function createMethodNotAllowedTerminalHandler(array $allowedMethods): Closure
361 360
     {
362 361
         // 405 Method Not Allowed
363
-        return function () use ($allowedMethods) {
362
+        return function() use ($allowedMethods) {
364 363
             return $this->createEmptyResponse(405, ['Accept' => implode(',', $allowedMethods)]);
365 364
         };
366 365
     }
@@ -371,7 +370,7 @@  discard block
 block discarded – undo
371 370
     private function createNotFoundTerminalHandler(): Closure
372 371
     {
373 372
         // 404 Not Found
374
-        return function () {
373
+        return function() {
375 374
             return $this->createEmptyResponse(404);
376 375
         };
377 376
     }
@@ -415,11 +414,11 @@  discard block
 block discarded – undo
415 414
                 [ServerRequestInterface::class, Closure::class, PsrContainerInterface::class],
416 415
                 ResponseInterface::class
417 416
             ),
418
-            'Middleware method should have signature ' .
417
+            'Middleware method should have signature '.
419 418
             '`public static methodName(ServerRequestInterface, Closure, PsrContainerInterface): ResponseInterface`'
420 419
         );
421 420
 
422
-        return function (ServerRequestInterface $request) use ($next, $middleware, $container): ResponseInterface {
421
+        return function(ServerRequestInterface $request) use ($next, $middleware, $container): ResponseInterface {
423 422
             return call_user_func($middleware, $request, $next, $container);
424 423
         };
425 424
     }
Please login to merge, or discard this patch.
src/Routing/BaseGroup.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     /**
119 119
      * @inheritdoc
120 120
      */
121
-    public function parentGroup(): ?GroupInterface
121
+    public function parentGroup(): ? GroupInterface
122 122
     {
123 123
         return $this->parent;
124 124
     }
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     /**
140 140
      * @inheritdoc
141 141
      */
142
-    public function getName(): ?string
142
+    public function getName(): ? string
143 143
     {
144 144
         return $this->name;
145 145
     }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     /**
168 168
      * @inheritdoc
169 169
      */
170
-    public function getRequestFactory(): ?callable
170
+    public function getRequestFactory(): ? callable
171 171
     {
172 172
         if ($this->isRequestFactorySet() === true) {
173 173
             return $this->requestFactory;
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
     /**
381 381
      * @return null|string
382 382
      */
383
-    private function getParentUriPrefix(): ?string
383
+    private function getParentUriPrefix(): ? string
384 384
     {
385 385
         $parent = $this->parentGroup();
386 386
         $result = $parent === null ? null : $parent->getUriPrefix();
Please login to merge, or discard this patch.
src/Routing/Router.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
     /**
147 147
      * @inheritdoc
148 148
      */
149
-    public function getUriPath(string $routeName): ?string
149
+    public function getUriPath(string $routeName): ? string
150 150
     {
151 151
         $this->checkRoutesLoaded();
152 152
 
153
-        list(, , $namedRouteUriPaths) = $this->cachedRoutes;
153
+        list(,, $namedRouteUriPaths) = $this->cachedRoutes;
154 154
 
155 155
         $result = array_key_exists($routeName, $namedRouteUriPaths) === true ? $namedRouteUriPaths[$routeName] : null;
156 156
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     ): string {
169 169
         $path   = $this->getUriPath($routeName);
170 170
         $path   = $path === null ? $path : $this->replacePlaceholders($path, $placeholders);
171
-        $url    = empty($queryParams) === true ? "$hostUri$path" : "$hostUri$path?" . http_build_query($queryParams);
171
+        $url    = empty($queryParams) === true ? "$hostUri$path" : "$hostUri$path?".http_build_query($queryParams);
172 172
 
173 173
         return $url;
174 174
     }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                     break;
228 228
                 case '}':
229 229
                     $result .= array_key_exists($curPlaceholder, $placeholders) === true ?
230
-                        $placeholders[$curPlaceholder] : '{' . $curPlaceholder . '}';
230
+                        $placeholders[$curPlaceholder] : '{'.$curPlaceholder.'}';
231 231
                     $inPlaceholder     = false;
232 232
                     $curPlaceholder    = null;
233 233
                     $inPlaceholderName = false;
Please login to merge, or discard this patch.
src/Routing/Route.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     /**
151 151
      * @inheritdoc
152 152
      */
153
-    public function getRequestFactory(): ?callable
153
+    public function getRequestFactory(): ? callable
154 154
     {
155 155
         if ($this->isUseGroupRequestFactory() === true) {
156 156
             return $this->getGroup()->getRequestFactory();
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
     /**
183 183
      * @inheritdoc
184 184
      */
185
-    public function getName(): ?string
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/Group.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
     /**
49 49
      * @inheritdoc
50 50
      */
51
-    public function parentGroup(): ?GroupInterface
51
+    public function parentGroup(): ? GroupInterface
52 52
     {
53 53
         $group = parent::parentGroup();
54 54
 
Please login to merge, or discard this patch.
src/Routing/NestedGroup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@
 block discarded – undo
34 34
     /**
35 35
      * @inheritdoc
36 36
      */
37
-    public function getName(): ?string
37
+    public function getName(): ? string
38 38
     {
39 39
         $parentGroupName = $this->parentGroup()->getName();
40 40
         $selfName        = parent::getName();
41
-        $result          = $parentGroupName !== null || $selfName !== null ? $parentGroupName . $selfName : null;
41
+        $result          = $parentGroupName !== null || $selfName !== null ? $parentGroupName.$selfName : null;
42 42
 
43 43
         return $result;
44 44
     }
Please login to merge, or discard this patch.