This commit is contained in:
as2252258@163.com
2021-03-06 20:38:13 +08:00
parent 53218bb493
commit 7fa3d3b6a4
+2 -4
View File
@@ -75,20 +75,18 @@ class Node extends HttpService
$controller = implode('\\', $this->namespace) . '\\' . $controller; $controller = implode('\\', $this->namespace) . '\\' . $controller;
} }
$this->handler = $this->getReflect($controller, $action); $this->handler = $this->getReflect($controller, $action);
$this->callback = Reduce::reduce($this->createDispatch(), $this->annotation());
} else if ($handler != null && !is_callable($handler, true)) { } else if ($handler != null && !is_callable($handler, true)) {
$this->_error = 'Controller is con\'t exec.'; $this->_error = 'Controller is con\'t exec.';
} else if ($handler instanceof Closure) { } else if ($handler instanceof Closure) {
$this->handler = $handler; $this->handler = $handler;
$this->callback = Reduce::reduce($this->createDispatch(), $this->annotation());
} else { } else {
[$controller, $action] = $this->handler = $handler; [$controller, $action] = $this->handler = $handler;
if (!($controller instanceof Controller)) { if (!($controller instanceof Controller)) {
return $this; return $this;
} }
$this->annotationInject(get_class($controller), $action); $this->annotationInject(get_class($controller), $action);
}
if (!empty($this->handler)) {
$this->callback = Reduce::reduce($this->createDispatch(), $this->annotation()); $this->callback = Reduce::reduce($this->createDispatch(), $this->annotation());
} }
return $this; return $this;