From 19835dba97736d74a9b182d77dc16341b77c21f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 27 Apr 2021 17:01:28 +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 | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index 19262469..fb88f7ce 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -41,9 +41,6 @@ class Node extends HttpService private string $_error = ''; - private array $rules = []; - - private string $_dataType = ''; /** @var ?Closure|?array */ @@ -358,7 +355,7 @@ class Node extends HttpService { $annotation = annotation()->getMethods($className, $action); if (empty($annotation)) { - return $this->injectRules($className, $action); + return $this; } foreach ($annotation as $attribute) { if ($attribute instanceof Interceptor) { @@ -374,22 +371,6 @@ class Node extends HttpService $this->addLimits($attribute->limits); } } - return $this->injectRules($className, $action); - } - - - /** - * @param string $controller - * @param string $action - * @return $this - * @throws \Exception - */ - private function injectRules(string $controller, string $action): static - { - /** @var HttpFilter $filter */ - $filter = Snowflake::app()->get('filter'); - $this->rules = $filter->getRules($controller, $action); - return $this; } @@ -460,6 +441,7 @@ class Node extends HttpService /** * @param string $search * @return Node|null + * @throws Exception */ public function findNode(string $search): ?Node {