Passed
Branch master (fcf200)
by Nícollas
01:54
created
src/Router/RouteManager.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -88,7 +88,9 @@  discard block
 block discarded – undo
88 88
      */
89 89
     private function compileGroupData()
90 90
     {
91
-        if(!is_a($this->group, RouteGroups::class)) return null;
91
+        if(!is_a($this->group, RouteGroups::class)) {
92
+            return null;
93
+        }
92 94
 
93 95
         $this->defaultName = $this->name = $this->group->name;
94 96
         $this->defaultNamespace = $this->group->namespace;
@@ -144,7 +146,9 @@  discard block
 block discarded – undo
144 146
      */
145 147
     protected function getWhere(String $param): ?String
146 148
     {
147
-        if (!isset($this->where[$param])) return null;
149
+        if (!isset($this->where[$param])) {
150
+            return null;
151
+        }
148 152
 
149 153
         return $this->where[$param];
150 154
     }
Please login to merge, or discard this patch.
src/Router/RouteCollection.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -152,7 +152,9 @@  discard block
 block discarded – undo
152 152
             $routes = $this->routes[$httpMethod];
153 153
         }
154 154
 
155
-        if (!is_array($routes)) return null;
155
+        if (!is_array($routes)) {
156
+            return null;
157
+        }
156 158
 
157 159
         $soughtRoute = null;
158 160
 
@@ -323,7 +325,9 @@  discard block
 block discarded – undo
323 325
      */
324 326
     protected function getHttpCode(String $slug)
325 327
     {
326
-        if (!isset($this->httpCodes[$slug])) return null;
328
+        if (!isset($this->httpCodes[$slug])) {
329
+            return null;
330
+        }
327 331
 
328 332
         return $this->httpCodes[$slug];
329 333
     }
@@ -353,7 +357,9 @@  discard block
 block discarded – undo
353 357
     {
354 358
         $method = strtoupper($method);
355 359
 
356
-        if (!isset($this->routes[$method])) return null;
360
+        if (!isset($this->routes[$method])) {
361
+            return null;
362
+        }
357 363
 
358 364
         return $this->routes[$method];
359 365
     }
Please login to merge, or discard this patch.
src/Router/Middlewares/MiddlewareCollection.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -139,7 +139,9 @@
 block discarded – undo
139 139
     protected function instanceMiddleware($middleware)
140 140
     {
141 141
         if (!preg_match("/\\\/", $middleware)) {
142
-            if (!$middlewareClass = $this->getByAlias($middleware)) return;
142
+            if (!$middlewareClass = $this->getByAlias($middleware)) {
143
+                return;
144
+            }
143 145
 
144 146
             return new $middlewareClass();
145 147
         }
Please login to merge, or discard this patch.
src/Http/Request.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -69,7 +69,9 @@  discard block
 block discarded – undo
69 69
     {
70 70
         $parsedRoute = parse_url($this->fullUrl ?? "/");
71 71
 
72
-        if (empty($data)) return $parsedRoute;
72
+        if (empty($data)) {
73
+            return $parsedRoute;
74
+        }
73 75
 
74 76
         if (isset($parsedRoute[$data])) {
75 77
             return $parsedRoute[$data];
@@ -101,7 +103,9 @@  discard block
 block discarded – undo
101 103
     {
102 104
         $path = $this->getParsedRoute();
103 105
 
104
-        if (!$path) return null;
106
+        if (!$path) {
107
+            return null;
108
+        }
105 109
 
106 110
         return "{$path['scheme']}://{$path['host']}{$this->path()}";
107 111
     }
@@ -196,7 +200,9 @@  discard block
 block discarded – undo
196 200
 
197 201
         if (!empty($diff)) {
198 202
             foreach ($routeParams as $index => $param) {
199
-                if (!isset($diff[$index])) return;
203
+                if (!isset($diff[$index])) {
204
+                    return;
205
+                }
200 206
 
201 207
                 if ($this->httpMethod != 'GET') {
202 208
                     $this->params[$param] = rawurldecode($diff[$index]);
@@ -298,7 +304,9 @@  discard block
 block discarded – undo
298 304
         }, $except);
299 305
 
300 306
         foreach ($except as $excession) {
301
-            if (!isset($this->data[$excession])) return;
307
+            if (!isset($this->data[$excession])) {
308
+                return;
309
+            }
302 310
 
303 311
             unset($allWithExcession[$excession]);
304 312
         }
@@ -374,7 +382,9 @@  discard block
 block discarded – undo
374 382
     {
375 383
         $authorizationHeader = $this->header('Authorization');
376 384
 
377
-        if (!$authorizationHeader) return null;
385
+        if (!$authorizationHeader) {
386
+            return null;
387
+        }
378 388
 
379 389
         if (preg_match("/^Bearer\s(.*)+$/", $authorizationHeader, $found)) {
380 390
             return $authorizationHeader;
Please login to merge, or discard this patch.