From c2708470a7a58f137b63cd43e364631fe7027494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 5 Mar 2021 17:33:16 +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 | 7 +++---- HttpServer/Route/Router.php | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index 31b27399..30e59a21 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -321,7 +321,9 @@ class Node extends HttpService if (empty($annotation)) { return $node; } -// var_dump($className, $action, $annotation); + if (str_contains($node->path, 'switch/map')) { + var_dump($className, $action, $annotation); + } foreach ($annotation as $name => $attribute) { if ($attribute instanceof \Annotation\Route\Interceptor) { $node->addInterceptor($attribute->interceptor); @@ -506,9 +508,6 @@ class Node extends HttpService } else { $class = [$class]; } - if (str_contains($this->path,'switch/map')) { - var_dump($class); - } foreach ($class as $closure) { if (is_string($closure)) { $closure = [Snowflake::createObject($closure), 'onHandler']; diff --git a/HttpServer/Route/Router.php b/HttpServer/Route/Router.php index e8a3c0fe..6f57bada 100644 --- a/HttpServer/Route/Router.php +++ b/HttpServer/Route/Router.php @@ -144,6 +144,7 @@ class Router extends HttpService implements RouterInterface if ($first !== '/') { $parent = $this->bindNode($parent, $explode, $method); } + $parent->path = $path; return $parent->bindHandler($handler); }