@@ -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 | } |
@@ -103,7 +103,9 @@ discard block |
||
| 103 | 103 | { |
| 104 | 104 | $path = $this->getParsedRoute(); |
| 105 | 105 | |
| 106 | - if (!$path) return null; |
|
| 106 | + if (!$path) { |
|
| 107 | + return null; |
|
| 108 | + } |
|
| 107 | 109 | |
| 108 | 110 | return "{$path['scheme']}://{$path['host']}{$this->path()}"; |
| 109 | 111 | } |
@@ -198,7 +200,9 @@ discard block |
||
| 198 | 200 | |
| 199 | 201 | if (!empty($diff)) { |
| 200 | 202 | foreach ($routeParams as $index => $param) { |
| 201 | - if (!isset($diff[$index])) return; |
|
| 203 | + if (!isset($diff[$index])) { |
|
| 204 | + return; |
|
| 205 | + } |
|
| 202 | 206 | |
| 203 | 207 | if ($this->httpMethod != 'GET') { |
| 204 | 208 | $this->params[$param] = rawurldecode($diff[$index]); |
@@ -300,7 +304,9 @@ discard block |
||
| 300 | 304 | }, $except); |
| 301 | 305 | |
| 302 | 306 | foreach ($except as $excession) { |
| 303 | - if (!isset($this->data[$excession])) return; |
|
| 307 | + if (!isset($this->data[$excession])) { |
|
| 308 | + return; |
|
| 309 | + } |
|
| 304 | 310 | |
| 305 | 311 | unset($allWithExcession[$excession]); |
| 306 | 312 | } |
@@ -376,7 +382,9 @@ discard block |
||
| 376 | 382 | { |
| 377 | 383 | $authorizationHeader = $this->header('Authorization'); |
| 378 | 384 | |
| 379 | - if (!$authorizationHeader) return null; |
|
| 385 | + if (!$authorizationHeader) { |
|
| 386 | + return null; |
|
| 387 | + } |
|
| 380 | 388 | |
| 381 | 389 | if (preg_match("/^Bearer\s(.*)+$/", $authorizationHeader, $found)) { |
| 382 | 390 | return $authorizationHeader; |