Skip to content

VS Code Intellisense reporting Undefined method 'insertBefore' #228

@n18l

Description

@n18l

I've noticed that my IDE (VS Code) has been highlighting the insertBefore method as unknown despite the fact that it works as expected. I took a quick peek and found that it's likely just a matter of documentation.

An AbstractNode's parent is documented as being an InnerNode (or null):

/**
* Contains the parent Node.
*
* @var ?InnerNode
*/
protected $parent;

But the getParent method is documented as returning an AbstractNode:

/**
* Returns the parent of node.
*
* @return AbstractNode
*/
public function getParent()
{
return $this->parent;
}

I'm not 100% sure what the documented return types should be, but at the very least they don't seem to match here, which is ultimately causing Intellisense to interpret something as broken.

Thanks a ton for this great library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions