From 55081e05a00fce42c6410eb256b042636ad5bf0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 5 Mar 2021 18:03:18 +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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index 114690e6..cbe5e489 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -8,6 +8,7 @@ namespace HttpServer\Route; use Annotation\Route\Middleware; use Closure; use HttpServer\Abstracts\HttpService; +use HttpServer\Controller; use HttpServer\Http\Request; use Exception; @@ -80,11 +81,11 @@ class Node extends HttpService $this->_error = 'Controller is con\'t exec.'; } else { [$controller, $action] = $this->handler = $handler; + if ($controller instanceof Controller) { + $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; } @@ -307,7 +308,6 @@ class Node extends HttpService /** - * @param Node $node * @param string $className * @param string $action * @return Node