File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -52,13 +52,15 @@ public static function getXPath(DOMNode $node): DOMXPath
5252 * @param \DOMNode $node The XML node.
5353 * @param string $query The query.
5454 * @param \DOMXPath $xpCache The DOMXPath object
55- * @return array<int<0, max>, \DOMNameSpaceNode|\ DOMNode|null > Array with matching DOM nodes.
55+ * @return array<\ DOMNode> Array with matching DOM nodes.
5656 */
5757 public static function xpQuery (DOMNode $ node , string $ query , DOMXPath $ xpCache ): array
5858 {
5959 $ ret = [];
6060
6161 $ results = $ xpCache ->query ($ query , $ node );
62+ Assert::notFalse ($ results , 'Malformed XPath query or invalid contextNode provided. ' );
63+
6264 for ($ i = 0 ; $ i < $ results ->length ; $ i ++) {
6365 $ ret [$ i ] = $ results ->item ($ i );
6466 }
You can’t perform that action at this time.
0 commit comments