From 081ffb7899b3bb8584ef71365d568a6f35f1eb98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 20 Apr 2021 10:33:06 +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 | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Annotation/Loader.php b/Annotation/Loader.php index ced4324a..c2f01408 100644 --- a/Annotation/Loader.php +++ b/Annotation/Loader.php @@ -230,17 +230,17 @@ class Loader extends BaseObject public function loadByDirectory(string $path, string|array $outPath = '') { try { - $path = '/' . trim($path, '/'); - foreach ($this->_directory as $key => $_path) { - $key = '/' . trim($key, '/'); - if (!str_starts_with($key, $path)) { - continue; - } - if (in_array($key, $outPath)) continue; - $this->execute($_path); - } +// $path = '/' . trim($path, '/'); +// foreach ($this->_directory as $key => $_path) { +// $key = '/' . trim($key, '/'); +// if (!str_starts_with($key, $path)) { +// continue; +// } +// if (in_array($key, $outPath)) continue; +// $this->execute($_path); +// } -// $this->each($path, $outPath); + $this->each($path, $outPath); } catch (Throwable $exception) { $this->addError($exception, 'throwable'); } @@ -278,17 +278,17 @@ class Loader extends BaseObject $this->_directory[$array][] = $className; -// $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); -// } + $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); + } }