mirror of
https://github.com/php/php-src.git
synced 2024-11-27 11:53:33 +08:00
Fix return value in stub file for DOMNodeList::item
Not explicitly documenting the possibility of returning DOMElement causes the Intelephense linter (a popular PHP linter with ~9 million downloads: https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client) to think this code is bad: $xp->query("whatever")->item(0)->getAttribute("foo"); DOMNode does not have getAttribute (while DOMElement does). Documenting the DOMElement return type should fix Intelephense's linter. Closes GH-11342.
This commit is contained in:
parent
c473787abb
commit
761b9a44f8
1
NEWS
1
NEWS
@ -10,6 +10,7 @@ PHP NEWS
|
||||
and segfaults with replaceWith). (nielsdos)
|
||||
. Fixed bug GH-10234 (Setting DOMAttr::textContent results in an empty
|
||||
attribute value). (nielsdos)
|
||||
. Fix return value in stub file for DOMNodeList::item. (divinity76)
|
||||
|
||||
- Opcache:
|
||||
. Fix allocation loop in zend_shared_alloc_startup(). (nielsdos)
|
||||
|
@ -232,7 +232,7 @@ class DOMNodeList implements IteratorAggregate, Countable
|
||||
|
||||
public function getIterator(): Iterator {}
|
||||
|
||||
/** @return DOMNode|DOMNameSpaceNode|null */
|
||||
/** @return DOMElement|DOMNode|DOMNameSpaceNode|null */
|
||||
public function item(int $index) {}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 74698bea9c5e0635cf91345e8512b9677489510c */
|
||||
* Stub hash: a62e383b05df81ea245a7993215fb8ff4e1c7f9d */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_dom_import_simplexml, 0, 1, DOMElement, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, node, IS_OBJECT, 0)
|
||||
|
Loading…
Reference in New Issue
Block a user