This commit is contained in:
2021-03-05 16:47:25 +08:00
parent 62339e8bd0
commit 2fedf6dd88
+6 -8
View File
@@ -82,20 +82,20 @@ class Node extends HttpService
$this->handler = $handler; $this->handler = $handler;
} }
if (!empty($this->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 $this;
} }
/** /**
* @return mixed * @return Closure
* @throws NotFindClassException
* @throws ReflectionException
*/ */
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 * @return mixed
* @throws Exception * @throws Exception