return $this->
createSubCrawler($this->
sibling($this->
getNode(0
)->parentNode->firstChild
));
} public function matches(string
$selector): bool
{ if (!
$this->nodes
) { return false;
} $converter =
$this->
createCssSelectorConverter();
$xpath =
$converter->
toXPath($selector, 'self::'
);
return 0 !==
$this->
filterRelativeXPath($xpath)->
count();
} /**
* Return first parents (heading toward the document root) of the Element that matches the provided selector.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill
*
* @throws \InvalidArgumentException When current node is empty
*/