From a166ed44b703894949748fbd7cbea080f5caf3e2 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Thu, 8 Apr 2021 01:13:39 +0800 Subject: [PATCH] modify --- Annotation/Loader.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Annotation/Loader.php b/Annotation/Loader.php index 5f7c9cbe..e6f48d25 100644 --- a/Annotation/Loader.php +++ b/Annotation/Loader.php @@ -274,15 +274,18 @@ class Loader extends BaseObject $DIRECTORY = explode(DIRECTORY_SEPARATOR, $filePath); array_pop($DIRECTORY); - $tree = $this->files; + $tree = null; foreach ($DIRECTORY as $value) { if (empty($value)) { continue; } - $tree = $tree->getChild($value); - - $tree->addFile($className); + if ($tree === null) { + $tree = $this->files->getChild($value); + } else { + $tree = $tree->getChild($value); + } } + $tree->addFile($className); }