Skip to content

Commit

Permalink
Fix return type of DOMXPath::query
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Dec 23, 2023
1 parent 981c7ba commit 011177e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions stubs/dom.stub
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class DOMElement extends DOMNode
}

/**
* @template-covariant TNode as DOMNode
* @template-covariant TNode as DOMNode|DOMNameSpaceNode
* @implements Traversable<int, TNode>
* @implements IteratorAggregate<int, TNode>
*/
Expand All @@ -76,7 +76,7 @@ class DOMXPath
* @param string $expression
* @param DOMNode|null $contextNode
* @param boolean $registerNodeNS
* @return DOMNodeList<DOMNode>|false
* @return DOMNodeList<DOMNode|DOMNameSpaceNode>|false
*/
public function query($expression, $contextNode, $registerNodeNS) {}

Expand Down
2 changes: 1 addition & 1 deletion tests/PHPStan/Analyser/data/bug-6748.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public function iterateNodes ($list): void
/** @param \DOMXPath $path */
public function xPathQuery ($path)
{
assertType('DOMNodeList<DOMNode>|false', $path->query(''));
assertType('DOMNodeList<DOMNode|DOMNameSpaceNode>|false', $path->query(''));
}
}

0 comments on commit 011177e

Please sign in to comment.