From 97bbff35fda020b62e04d647eb799bff09da8ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 20 Apr 2021 11:52:28 +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, 7 insertions(+), 7 deletions(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index d81d1c0b..206e10cb 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -529,15 +529,15 @@ class Node extends HttpService private function httpFilter(): mixed { try { + $dispatchParams = func_num_args(); + if (empty($dispatchParams)) { + $dispatchParams = \request(); + } if ($this->handler instanceof Closure) { - return call_user_func($this->handler, func_get_args()); + return call_user_func($this->handler, $dispatchParams); } - if (func_num_args() >= 1) { - return $this->runWith($this->callback, func_get_args()); - } else { - return $this->runWith($this->callback, \request()); - } - return $this->runFilter(...func_get_args()); + return $this->runWith($this->callback, $dispatchParams); + return $this->runFilter(...$dispatchParams); } catch (Throwable $throwable) { $this->addError($throwable, 'throwable');