From 9f2926d1df62afd71267f9b7f631e0b76a6b827a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 5 Mar 2021 18:45:20 +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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index a859f0c4..e67968a4 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -98,8 +98,9 @@ class Node extends HttpService */ public function createDispatch(): Closure { - return function () { - return Dispatch::create($this->handler, func_get_args())->dispatch(); + $handler = $this->handler; + return function () use ($handler) { + return Dispatch::create($handler, func_get_args())->dispatch(); }; }