eee
This commit is contained in:
@@ -14,19 +14,14 @@ abstract class AbstractHandler
|
|||||||
|
|
||||||
public int $offset = 0;
|
public int $offset = 0;
|
||||||
|
|
||||||
public array $middlewares = [];
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $middlewares
|
* @param array $middlewares
|
||||||
* @param Handler $handler
|
* @param Handler $handler
|
||||||
* @throws
|
* @throws
|
||||||
*/
|
*/
|
||||||
public function __construct(array $middlewares, public Handler $handler)
|
public function __construct(public array $middlewares, public Handler $handler)
|
||||||
{
|
{
|
||||||
foreach ($middlewares as $middleware) {
|
|
||||||
$this->middlewares[] = di($middleware);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class Middleware
|
|||||||
{
|
{
|
||||||
$path = $className . '::' . $method;
|
$path = $className . '::' . $method;
|
||||||
if (!isset(static::$manager[$path])) {
|
if (!isset(static::$manager[$path])) {
|
||||||
static::$manager[$path] = static::$mapping[$path] = [];
|
static::$mapping[$path] = [];
|
||||||
}
|
}
|
||||||
if (!in_array($middleware, static::$mapping[$path])) {
|
if (!in_array($middleware, static::$mapping[$path])) {
|
||||||
static::$mapping[$path][] = $middleware;
|
static::$mapping[$path][] = $middleware;
|
||||||
|
|||||||
Reference in New Issue
Block a user