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