chore(router): Remove redundant middleware count check
This commit is contained in:
@@ -257,10 +257,8 @@ class Router
|
|||||||
static::$$method[] = static::parse($path, $callback);
|
static::$$method[] = static::parse($path, $callback);
|
||||||
static::$last = [$method, count(static::$$method) - 1];
|
static::$last = [$method, count(static::$$method) - 1];
|
||||||
|
|
||||||
if (count(static::$withMiddlewares) > 0) {
|
foreach (static::$withMiddlewares as $middleware) {
|
||||||
foreach (static::$withMiddlewares as $middleware) {
|
static::middleware($middleware);
|
||||||
static::middleware($middleware);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new static();
|
return new static();
|
||||||
|
|||||||
Reference in New Issue
Block a user