QueryPath\CSS\DOMTraverser::combineSibling PHP Method

combineSibling() public method

According to the spec, this only tests elements LEFT of the provided node.
public combineSibling ( DOMNode $node, array $selectors, integer $index ) : boolean
$node DOMNode A DOM Node.
$selectors array The selectors array.
$index integer The current index to the operative simple selector in the selectors array.
return boolean TRUE if the combination matches, FALSE otherwise.
    public function combineSibling($node, $selectors, $index)
    {
        while (!empty($node->previousSibling)) {
            $node = $node->previousSibling;
            if ($node->nodeType == XML_ELEMENT_NODE && $this->matchesSimpleSelector($node, $selectors, $index)) {
                return true;
            }
        }
        return false;
    }