From 65aaebef0b7e303faaacd5669829b8ef1a866cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 27 Jul 2021 16:22:49 +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 | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index 5bea1bfe..726535c4 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -151,11 +151,8 @@ class Node extends HttpService $callback = [$reflect->getMethod('invoke'), 'invokeArgs']; return static function () use ($callback, $application, $reflect) { $dispatchParam = Context::getContext('dispatch-param', [\request()]); - $asp = $reflect->newInstance($application->handler); - if (is_array($application->handler)) { - Snowflake::injectProperty($application->handler[0]); - } - call_user_func($callback, $asp, $dispatchParam); + + call_user_func($callback, $reflect->newInstance($application->handler), $dispatchParam); }; } @@ -168,9 +165,6 @@ class Node extends HttpService { return static function () use ($application) { $dispatchParam = Context::getContext('dispatch-param', [\request()]); - if (is_array($application->handler)) { - Snowflake::injectProperty($application->handler[0]); - } return call_user_func($application->handler, ...$dispatchParam); }; }