We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 95a85b6 commit a5a457fCopy full SHA for a5a457f
1 file changed
src/XPath/XPath.php
@@ -52,13 +52,15 @@ public static function getXPath(DOMNode $node): DOMXPath
52
* @param \DOMNode $node The XML node.
53
* @param string $query The query.
54
* @param \DOMXPath $xpCache The DOMXPath object
55
- * @return array<int<0, max>, \DOMNameSpaceNode|\DOMNode|null> Array with matching DOM nodes.
+ * @return array<\DOMNode> Array with matching DOM nodes.
56
*/
57
public static function xpQuery(DOMNode $node, string $query, DOMXPath $xpCache): array
58
{
59
$ret = [];
60
61
$results = $xpCache->query($query, $node);
62
+ Assert::notFalse($results, 'Malformed XPath query or invalid contextNode provided.');
63
+
64
for ($i = 0; $i < $results->length; $i++) {
65
$ret[$i] = $results->item($i);
66
}
0 commit comments