From 2baf2847abe83f1d8166dc9efb0be490f02c7924 Mon Sep 17 00:00:00 2001 From: xl Date: Thu, 29 Aug 2024 16:19:24 +0800 Subject: [PATCH] eee --- src/Base/AbstractHandler.php | 7 +------ src/Base/Middleware.php | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Base/AbstractHandler.php b/src/Base/AbstractHandler.php index 56c4e93..61e4f8c 100644 --- a/src/Base/AbstractHandler.php +++ b/src/Base/AbstractHandler.php @@ -14,19 +14,14 @@ abstract class AbstractHandler public int $offset = 0; - public array $middlewares = []; - /** * @param array $middlewares * @param Handler $handler * @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); - } } /** diff --git a/src/Base/Middleware.php b/src/Base/Middleware.php index f587912..7fcf7db 100644 --- a/src/Base/Middleware.php +++ b/src/Base/Middleware.php @@ -28,7 +28,7 @@ class Middleware { $path = $className . '::' . $method; if (!isset(static::$manager[$path])) { - static::$manager[$path] = static::$mapping[$path] = []; + static::$mapping[$path] = []; } if (!in_array($middleware, static::$mapping[$path])) { static::$mapping[$path][] = $middleware;