This commit is contained in:
2021-08-05 13:47:47 +08:00
parent fa34e2eec0
commit a9510ee353
2 changed files with 4 additions and 10 deletions
+3 -9
View File
@@ -256,18 +256,12 @@ class Node extends HttpService
/**
* @param Node $node
* @param string $field
* @return Node
*/
public function addChild(Node $node, string $field): Node
public function addChild(Node $node): Node
{
/** @var Node $oLod */
$oLod = $this->childes[$field] ?? null;
if (!empty($oLod)) {
$node = $oLod;
}
$this->childes[$field] = $node;
return $this->childes[$field];
$this->childes[] = $node;
return $node;
}