chore(router): Remove redundant middleware count check

This commit is contained in:
kj
2026-02-02 10:23:48 -03:00
parent 78e199e300
commit c0b9f3851a

View File

@@ -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();