public function addChild(Node $node) : self
    {
        $node->setParent($this);
        $this->children[] = $node;

        return $this;
    }
public function addChild(Node $node) : self
    {
        $node->setParent($this);
        $this->children[] = $node;

        return $this;
    }
public function addChild ( Node $ node ) : self { $ node -> setParent ( $ this ) ; $ this -> children [ ] = $ node ; return $ this ; }
Adds a child to this node

@param Node $node The child to add
@return self Returns this for chaining
Adds a child to this node