@@ -89,12 +89,12 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | private function compileGroupData() |
| 91 | 91 | { |
| 92 | - if(!is_a($this->group, RouteGroups::class)) return null; |
|
| 92 | + if (!is_a($this->group, RouteGroups::class)) return null; |
|
| 93 | 93 | |
| 94 | 94 | $this->defaultName = $this->name = $this->group->name; |
| 95 | 95 | $this->defaultNamespace = $this->group->namespace; |
| 96 | 96 | |
| 97 | - if(is_a($this->group->middlewares, MiddlewareCollection::class)) { |
|
| 97 | + if (is_a($this->group->middlewares, MiddlewareCollection::class)) { |
|
| 98 | 98 | $this->middleware = $this->group->middlewares; |
| 99 | 99 | } |
| 100 | 100 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | preg_match_all("~\{\s*([a-zA-Z_][a-zA-Z0-9_-]*)\??\}~x", $route, $params, PREG_SET_ORDER); |
| 163 | 163 | |
| 164 | 164 | if ($wordOnly) { |
| 165 | - $params = array_map(function ($param) { |
|
| 165 | + $params = array_map(function($param) { |
|
| 166 | 166 | return $param[1]; |
| 167 | 167 | }, $params); |
| 168 | 168 | } |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | private function resolveHandler(String $handler) |
| 229 | 229 | { |
| 230 | - if(!$this->defaultNamespace) { |
|
| 230 | + if (!$this->defaultNamespace) { |
|
| 231 | 231 | return $handler; |
| 232 | 232 | } |
| 233 | 233 | |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | */ |
| 330 | 330 | public function middleware($middleware): RouteManager |
| 331 | 331 | { |
| 332 | - if(is_a($this->middleware, MiddlewareCollection::class)) { |
|
| 332 | + if (is_a($this->middleware, MiddlewareCollection::class)) { |
|
| 333 | 333 | $middleware = $this->middleware->storeMiddleware($middleware); |
| 334 | 334 | } |
| 335 | 335 | |
@@ -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. |
@@ -295,7 +295,7 @@ |
||
| 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 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | public function where(array $matches) |
| 19 | 19 | { |
| 20 | - array_map(function ($key, $value) { |
|
| 20 | + array_map(function($key, $value) { |
|
| 21 | 21 | $this->setWhereData($key, $value); |
| 22 | 22 | }, array_keys($matches), $matches); |
| 23 | 23 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function name(String $name, Bool $ignoreDefault = false) |
| 98 | 98 | { |
| 99 | - if($ignoreDefault) { |
|
| 99 | + if ($ignoreDefault) { |
|
| 100 | 100 | $this->setName($name); |
| 101 | 101 | } else { |
| 102 | 102 | $this->setName($this->getDefaultName() . $name); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | { |
| 126 | 126 | $middlewares = $this->middlewares; |
| 127 | 127 | |
| 128 | - if(is_string($middlewares)) { |
|
| 128 | + if (is_string($middlewares)) { |
|
| 129 | 129 | $middlewares = explode(',', $middlewares); |
| 130 | 130 | } |
| 131 | 131 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | protected function resolveNestedMiddleware(Array $middlewares): void |
| 146 | 146 | { |
| 147 | - $this->queue = array_map(function ($middleware) { |
|
| 147 | + $this->queue = array_map(function($middleware) { |
|
| 148 | 148 | $middleware = trim(rtrim($middleware)); |
| 149 | 149 | |
| 150 | 150 | return $this->instanceMiddleware($middleware); |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | return $currentMiddleware->handle( |
| 243 | 243 | $this->currentRequest, |
| 244 | - fn () => $this->next() |
|
| 244 | + fn() => $this->next() |
|
| 245 | 245 | ); |
| 246 | 246 | } |
| 247 | 247 | } |