-
-
Notifications
You must be signed in to change notification settings - Fork 469
Description
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):
php-html-parser/src/PHPHtmlParser/Dom/Node/AbstractNode.php
Lines 44 to 49 in c116346
| /** | |
| * Contains the parent Node. | |
| * | |
| * @var ?InnerNode | |
| */ | |
| protected $parent; |
But the getParent method is documented as returning an AbstractNode:
php-html-parser/src/PHPHtmlParser/Dom/Node/AbstractNode.php
Lines 154 to 162 in c116346
| /** | |
| * 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!