From 9d2ac7655ffd75a6200b9ce2520388f0b50f52ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 15 Dec 2020 16:48:01 +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/Annotation.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Annotation/Annotation.php b/Annotation/Annotation.php index a697385e..e2616ee1 100644 --- a/Annotation/Annotation.php +++ b/Annotation/Annotation.php @@ -26,6 +26,7 @@ class Annotation extends Component /** * @param string $path + * @param string $namespace * @param string $alias * @return $this * @throws ReflectionException @@ -65,6 +66,7 @@ class Annotation extends Component /** * @param array $paths + * @param string $namespace * @param string $alias * @return $this * @throws ReflectionException @@ -80,8 +82,11 @@ class Annotation extends Component $explode_pop = array_pop($explode); if (is_file($path)) { $explode_pop = str_replace('.php', '', $explode_pop); - - $this->_annotations[$alias][] = $this->getReflect($namespace . '\\' . $explode_pop); + $annotation = $this->getReflect($namespace . '\\' . $explode_pop); + if (empty($annotation)) { + continue; + } + $this->_annotations[$alias][] = $annotation; } else { $this->scanDir(glob($path . '/*'), $namespace . '\\' . $explode_pop, $alias); }