This commit is contained in:
2021-08-02 18:20:02 +08:00
parent d23b9384b0
commit b1081dd079
+2 -2
View File
@@ -95,6 +95,7 @@ class Node extends HttpService
} else { } else {
$this->handler = $handler; $this->handler = $handler;
} }
$this->setParameters($this->handler);
return $this->injectMiddleware(); return $this->injectMiddleware();
} }
@@ -118,7 +119,6 @@ class Node extends HttpService
$this->handler[0], $this->handler[1], $this->createDispatch() $this->handler[0], $this->handler[1], $this->createDispatch()
); );
} }
$this->setParameters($this->handler);
return $this; return $this;
} }
@@ -130,7 +130,7 @@ class Node extends HttpService
* @throws ReflectionException * @throws ReflectionException
* @throws NotFindClassException * @throws NotFindClassException
*/ */
private function setParameters($handler) public function setParameters($handler)
{ {
$container = Snowflake::getDi(); $container = Snowflake::getDi();
if ($handler instanceof Closure) { if ($handler instanceof Closure) {