public function addChild(AstNode $node): AstNode
    {
        $node->parent = $this;
        $this->children[] = $node;

        return $this;
    }
public function addChild(AstNode $node): AstNode
    {
        $node->parent = $this;
        $this->children[] = $node;

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

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