From 2fedf6dd88f4714aa8c675b1f026222942661b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 5 Mar 2021 16:47:25 +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 --- HttpServer/Route/Node.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index 8d42fd84..663bcab4 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -82,20 +82,20 @@ class Node extends HttpService $this->handler = $handler; } if (!empty($this->handler)) { - $this->callback = Reduce::reduce([$this, 'createDispatch'], $this->annotation($this)); + $this->callback = Reduce::reduce($this->createDispatch(), $this->annotation($this)); } return $this; } /** - * @return mixed - * @throws NotFindClassException - * @throws ReflectionException + * @return Closure */ - public function createDispatch(): mixed + public function createDispatch(): Closure { - return Dispatch::create($this->handler, func_get_args())->dispatch(); + return function () { + return Dispatch::create($this->handler, func_get_args())->dispatch(); + }; } @@ -550,8 +550,6 @@ class Node extends HttpService } - - /** * @return mixed * @throws Exception