From c8605c992ab705f49d695cfc85a41eb995a530b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 19 Apr 2021 16:10:57 +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 | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Annotation/Loader.php b/Annotation/Loader.php index a1db2716..cc987b48 100644 --- a/Annotation/Loader.php +++ b/Annotation/Loader.php @@ -276,19 +276,22 @@ class Loader extends BaseObject { $array = explode('/', $filePath); array_pop($array); - $this->_directory['/' . implode('/', $array)][] = $className; - $directory = $this->splitDirectory($filePath); - array_pop($directory); + $array = '/' . trim(implode('/', $array), '/'); - $tree = null; - foreach ($directory as $value) { - $tree = $this->getTree($tree, $value); - } + $this->_directory[$array][] = $className; - if ($tree instanceof FileTree) { - $tree->addFile($className, $filePath); - } +// $directory = $this->splitDirectory($filePath); +// array_pop($directory); +// +// $tree = null; +// foreach ($directory as $value) { +// $tree = $this->getTree($tree, $value); +// } +// +// if ($tree instanceof FileTree) { +// $tree->addFile($className, $filePath); +// } }