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); }