From 2a3338a41edc5a911d49e6e77f3385576b939144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Sun, 26 Sep 2021 15:30:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- http-handler/Abstracts/Handler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-handler/Abstracts/Handler.php b/http-handler/Abstracts/Handler.php index 8bcac412..95a9fa62 100644 --- a/http-handler/Abstracts/Handler.php +++ b/http-handler/Abstracts/Handler.php @@ -28,7 +28,7 @@ abstract class Handler implements RequestHandlerInterface /** - * @param \Http\Handler\Handler $handler + * @param CHl $handler * @param array|null $middlewares */ public function __construct(public CHl $handler, public ?array $middlewares) @@ -44,7 +44,7 @@ abstract class Handler implements RequestHandlerInterface */ protected function execute(ServerRequestInterface $request): ResponseInterface { - if (empty($this->middlewares) || !array_key_exists($this->offset, $this->middlewares)) { + if (empty($this->middlewares) || !isset($this->middlewares[$this->offset])) { return $this->dispatcher($request); }