-
Notifications
You must be signed in to change notification settings - Fork 811
Improve DomNode methods return type #1761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* The old node. | ||
* </p> | ||
* @return DOMNode|false The old node or false if an error occur. | ||
* @return TNode|false The old node or false if an error occur. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the phpdoc and https://www.php.net/manual/en/domnode.replacechild.php
the old node is returned which is the second param if I understand.
* The removed child. | ||
* </p> | ||
* @return DOMNode If the child could be removed the functions returns the old child. | ||
* @return TNode|false If the child could be removed the functions returns the old child. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returns the child removed (which is the one in param)
AND false
was missing
* The appended child. | ||
* </p> | ||
* @return DOMNode The node added. | ||
* @return TNode|false The node added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returns the node added (which is coming form the param)
AND false
was missing
* The new node. | ||
* </p> | ||
* @param null|DOMNode $child [optional] <p> | ||
* The reference node. If not supplied, newnode is | ||
* appended to the children. | ||
* </p> | ||
* @return DOMNode The inserted node. | ||
* @return TNode|false The inserted node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the phpdoc and https://www.php.net/manual/en/domnode.insertbefore.php
it returns the node inserted, which is the one coming from the param.
AND false
was missing
@@ -226,7 +230,7 @@ public function hasChildNodes(): bool {} | |||
* Indicates whether to copy all descendant nodes. This parameter is | |||
* defaulted to false. | |||
* </p> | |||
* @return static The cloned node. | |||
* @return static|false The cloned node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw you review some of my PR @LolGleb ; do you mind taking a look at this one too ? Thanks |
cc @isfedorov