@@ -88,7 +88,9 @@ discard block |
||
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 |
||
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 | } |
@@ -152,7 +152,9 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -139,7 +139,9 @@ |
||
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 | } |
@@ -69,7 +69,9 @@ discard block |
||
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 |
||
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 | } |
@@ -295,7 +299,9 @@ discard block |
||
295 | 299 | }, $except); |
296 | 300 | |
297 | 301 | foreach ($except as $excession) { |
298 | - if (!isset($this->data[$excession])) return; |
|
302 | + if (!isset($this->data[$excession])) { |
|
303 | + return; |
|
304 | + } |
|
299 | 305 | |
300 | 306 | unset($allWithExcession[$excession]); |
301 | 307 | } |
@@ -371,7 +377,9 @@ discard block |
||
371 | 377 | { |
372 | 378 | $authorizationHeader = $this->header('Authorization'); |
373 | 379 | |
374 | - if (!$authorizationHeader) return null; |
|
380 | + if (!$authorizationHeader) { |
|
381 | + return null; |
|
382 | + } |
|
375 | 383 | |
376 | 384 | if (preg_match("/^Bearer\s(.*)+$/", $authorizationHeader, $found)) { |
377 | 385 | return $authorizationHeader; |