@@ -88,12 +88,12 @@ 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)) return null; |
|
| 92 | 92 | |
| 93 | 93 | $this->defaultName = $this->name = $this->group->name; |
| 94 | 94 | $this->defaultNamespace = $this->group->namespace; |
| 95 | 95 | |
| 96 | - if(is_a($this->group->middlewares, MiddlewareCollection::class)) { |
|
| 96 | + if (is_a($this->group->middlewares, MiddlewareCollection::class)) { |
|
| 97 | 97 | $this->middleware = $this->group->middlewares; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | preg_match_all("~\{\s*([a-zA-Z_][a-zA-Z0-9_-]*)\??\}~x", $route, $params, PREG_SET_ORDER); |
| 162 | 162 | |
| 163 | 163 | if ($wordOnly) { |
| 164 | - $params = array_map(function ($param) { |
|
| 164 | + $params = array_map(function($param) { |
|
| 165 | 165 | return $param[1]; |
| 166 | 166 | }, $params); |
| 167 | 167 | } |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | */ |
| 227 | 227 | private function resolveHandler(String $handler) |
| 228 | 228 | { |
| 229 | - if(!$this->defaultNamespace) { |
|
| 229 | + if (!$this->defaultNamespace) { |
|
| 230 | 230 | return $handler; |
| 231 | 231 | } |
| 232 | 232 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | $methods = array_map("strtoupper", $methods); |
| 102 | 102 | |
| 103 | - array_map(function ($method) use ($uri, $callback) { |
|
| 103 | + array_map(function($method) use ($uri, $callback) { |
|
| 104 | 104 | $this->routes[$method][$uri] = $this->addRouter($uri, $callback); |
| 105 | 105 | }, $methods); |
| 106 | 106 | } |
@@ -260,10 +260,10 @@ discard block |
||
| 260 | 260 | ); |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | - if($this->instanceOf($route->getMiddleware(), MiddlewareCollection::class)) { |
|
| 263 | + if ($this->instanceOf($route->getMiddleware(), MiddlewareCollection::class)) { |
|
| 264 | 264 | $route->getMiddleware()->setRequest($route->request()); |
| 265 | 265 | |
| 266 | - if(!$route->getMiddleware()->execute()) { |
|
| 266 | + if (!$route->getMiddleware()->execute()) { |
|
| 267 | 267 | $this->setHttpCode($this->httpCodes["notFound"]); |
| 268 | 268 | |
| 269 | 269 | $this->throwException( |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | protected function instanceMiddleware($middleware) |
| 105 | 105 | { |
| 106 | 106 | if (!preg_match("/\\\/", $middleware)) { |
| 107 | - if(!$middlewareClass = $this->getByAlias($middleware)) return; |
|
| 107 | + if (!$middlewareClass = $this->getByAlias($middleware)) return; |
|
| 108 | 108 | |
| 109 | 109 | return new $middlewareClass(); |
| 110 | 110 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $this->httpMethod = $_SERVER['REQUEST_METHOD'] ?? ''; |
| 27 | 27 | $this->queryStrings = $_GET; |
| 28 | 28 | |
| 29 | - if(isset($this->queryStrings["route"])) { |
|
| 29 | + if (isset($this->queryStrings["route"])) { |
|
| 30 | 30 | unset($this->queryStrings["route"]); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -92,11 +92,11 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function __get(String $data) |
| 94 | 94 | { |
| 95 | - if(isset($this->data[$data])) { |
|
| 95 | + if (isset($this->data[$data])) { |
|
| 96 | 96 | return $this->data[$data]; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if(isset($this->queryStrings[$data])) { |
|
| 99 | + if (isset($this->queryStrings[$data])) { |
|
| 100 | 100 | return $this->queryStrings[$data]; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | $allWithExcession = $this->data; |
| 197 | 197 | $except = explode(',', $except); |
| 198 | 198 | |
| 199 | - $except = array_map(function ($excession) { |
|
| 199 | + $except = array_map(function($excession) { |
|
| 200 | 200 | return trim(rtrim($excession)); |
| 201 | 201 | }, $except); |
| 202 | 202 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public function where(array $matches): RouteManager |
| 18 | 18 | { |
| 19 | - array_map(function ($key, $value) { |
|
| 19 | + array_map(function($key, $value) { |
|
| 20 | 20 | $this->where[$key] = $value; |
| 21 | 21 | }, array_keys($matches), $matches); |
| 22 | 22 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | public function name(String $name, Bool $ignoreDefault = false): RouteManager |
| 103 | 103 | { |
| 104 | - if($ignoreDefault) { |
|
| 104 | + if ($ignoreDefault) { |
|
| 105 | 105 | $this->name = $name; |
| 106 | 106 | } else { |
| 107 | 107 | $this->name = $this->defaultName . $name; |