modify
This commit is contained in:
+21
-11
@@ -279,13 +279,11 @@ class Loader extends BaseObject
|
||||
if (empty($value)) {
|
||||
continue;
|
||||
}
|
||||
if ($tree === null) {
|
||||
$tree = $this->files->getChild($value);
|
||||
} else {
|
||||
$tree = $tree->getChild($value);
|
||||
}
|
||||
$tree = $this->getTree($tree, $value);
|
||||
}
|
||||
if ($tree instanceof FileTree) {
|
||||
$tree->addFile($className);
|
||||
}
|
||||
$tree->addFile($className);
|
||||
}
|
||||
|
||||
|
||||
@@ -302,11 +300,7 @@ class Loader extends BaseObject
|
||||
if (empty($value)) {
|
||||
continue;
|
||||
}
|
||||
if ($tree === null) {
|
||||
$tree = $this->files->getChild($value);
|
||||
} else {
|
||||
$tree = $tree->getChild($value);
|
||||
}
|
||||
$tree = $this->getTree($tree, $value);
|
||||
}
|
||||
if ($tree instanceof FileTree) {
|
||||
$this->eachNode($tree->getChildes());
|
||||
@@ -316,6 +310,22 @@ class Loader extends BaseObject
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $tree
|
||||
* @param $value
|
||||
* @return FileTree
|
||||
*/
|
||||
private function getTree($tree, $value): FileTree
|
||||
{
|
||||
if ($tree === null) {
|
||||
$tree = $this->files->getChild($value);
|
||||
} else {
|
||||
$tree = $tree->getChild($value);
|
||||
}
|
||||
return $tree;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param FileTree[] $nodes
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user