From 1ee39fee64d828ebf5cc34833896aa53173dd217 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Wed, 21 Apr 2021 01:49:17 +0800 Subject: [PATCH] modify --- HttpServer/Route/Dispatch/Dispatch.php | 2 +- HttpServer/Route/Node.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/HttpServer/Route/Dispatch/Dispatch.php b/HttpServer/Route/Dispatch/Dispatch.php index ad9f34d4..da080747 100644 --- a/HttpServer/Route/Dispatch/Dispatch.php +++ b/HttpServer/Route/Dispatch/Dispatch.php @@ -32,7 +32,7 @@ class Dispatch * @throws NotFindClassException * @throws ReflectionException */ - public static function create($handler, $request): static + public static function create($handler): static { $class = new static(); $class->handler = $handler; diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index 0f24647d..99161059 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -127,9 +127,7 @@ class Node extends HttpService public function createDispatch(): Closure { return function () { - return Dispatch::create($this->handler,\request())->dispatch(); - - return call_user_func($this->handler, ...$dispatchParam); + return Dispatch::create($this->handler)->dispatch(); }; }