From 03137da76ecb9c1c895d53eba347587bc3b870ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 3 Aug 2021 11:08:43 +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 --- Annotation/Loader.php | 5 ++--- HttpServer/Route/Router.php | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Annotation/Loader.php b/Annotation/Loader.php index c8f77a08..d698a310 100644 --- a/Annotation/Loader.php +++ b/Annotation/Loader.php @@ -138,9 +138,7 @@ class Loader extends BaseObject return; } $replace = $this->getReflect($path, $namespace); - if (empty($replace) || count($replace->getAttributes(Target::class)) < 1) { - return; - } + $this->appendFileToDirectory($path->getRealPath(), $replace->getName()); static::$_classes[] = $replace->getName(); @@ -177,6 +175,7 @@ class Loader extends BaseObject if (!str_starts_with($key, $path)) { continue; } + unset(static::$_directory[$key]); foreach ($_path as $item) { $paths[$key] = $item; } diff --git a/HttpServer/Route/Router.php b/HttpServer/Route/Router.php index 8a785ad5..6daca769 100644 --- a/HttpServer/Route/Router.php +++ b/HttpServer/Route/Router.php @@ -641,9 +641,6 @@ class Router extends HttpService implements RouterInterface continue; } foreach ($attribute as $item) { - if ($item instanceof Route) { - var_dump($item->uri . '::' . $item->method); - } $item->execute($instance, $method); } }