Skip to content

Commit ad5347b

Browse files
committed
Fix XDOMPath::query() return type
Resolves phpstan/phpstan#13595
1 parent 1cb8fc2 commit ad5347b

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

stubs/dom.stub

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,6 @@ class DOMNodeList implements IteratorAggregate, Countable
7979

8080
}
8181

82-
class DOMXPath
83-
{
84-
85-
/**
86-
* @param string $expression
87-
* @param DOMNode|null $contextNode
88-
* @param boolean $registerNodeNS
89-
* @return DOMNodeList<DOMNode>|false
90-
*/
91-
public function query($expression, $contextNode, $registerNodeNS) {}
92-
93-
}
94-
9582
class DOMAttr extends DOMNode
9683
{
9784

tests/PHPStan/Analyser/nsrt/bug-6748.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ public function iterateNodes ($list): void
1717
/** @param \DOMXPath $path */
1818
public function xPathQuery ($path)
1919
{
20-
assertType('DOMNodeList<DOMNode>|false', $path->query(''));
20+
assertType('DOMNodeList<DOMNameSpaceNode|DOMNode>|false', $path->query(''));
2121
}
2222
}

0 commit comments

Comments
 (0)