@@ -102,7 +102,7 @@ |
||
| 102 | 102 | |
| 103 | 103 | $methods = array_map("strtoupper", $methods); |
| 104 | 104 | |
| 105 | - array_map(function ($method) use ($uri, $callback) { |
|
| 105 | + array_map(function($method) use ($uri, $callback) { |
|
| 106 | 106 | $this->routes[$method][$uri] = $this->addRouter($uri, $callback); |
| 107 | 107 | }, $methods); |
| 108 | 108 | } |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | use MinasRouter\Helpers\Functions; |
| 4 | 4 | |
| 5 | -if (! function_exists('router')) { |
|
| 5 | +if (!function_exists('router')) { |
|
| 6 | 6 | /** |
| 7 | 7 | * Method responsible for returning a |
| 8 | 8 | * new instance of Functions. |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function query(?String $name = null, ?String $asDefault = null) |
| 145 | 145 | { |
| 146 | - if(!$name) { |
|
| 146 | + if (!$name) { |
|
| 147 | 147 | return $this->queryStrings; |
| 148 | 148 | } |
| 149 | 149 | |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | $allWithExcession = $this->data; |
| 296 | 296 | $except = explode(',', $except); |
| 297 | 297 | |
| 298 | - $except = array_map(function ($excession) { |
|
| 298 | + $except = array_map(function($excession) { |
|
| 299 | 299 | return trim(rtrim($excession)); |
| 300 | 300 | }, $except); |
| 301 | 301 | |
@@ -384,9 +384,9 @@ discard block |
||
| 384 | 384 | { |
| 385 | 385 | $authorizationHeader = $this->header('Authorization'); |
| 386 | 386 | |
| 387 | - if(!$authorizationHeader) return null; |
|
| 387 | + if (!$authorizationHeader) return null; |
|
| 388 | 388 | |
| 389 | - if(preg_match("/^Bearer\s(.*)+$/", $authorizationHeader, $found)) { |
|
| 389 | + if (preg_match("/^Bearer\s(.*)+$/", $authorizationHeader, $found)) { |
|
| 390 | 390 | return $authorizationHeader; |
| 391 | 391 | } |
| 392 | 392 | |
@@ -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 | } |
@@ -384,7 +390,9 @@ discard block |
||
| 384 | 390 | { |
| 385 | 391 | $authorizationHeader = $this->header('Authorization'); |
| 386 | 392 | |
| 387 | - if(!$authorizationHeader) return null; |
|
| 393 | + if(!$authorizationHeader) { |
|
| 394 | + return null; |
|
| 395 | + } |
|
| 388 | 396 | |
| 389 | 397 | if(preg_match("/^Bearer\s(.*)+$/", $authorizationHeader, $found)) { |
| 390 | 398 | return $authorizationHeader; |