QueryPath\CSS\DOMTraverser::combine PHP Method

combine() public method

If the next selector is combined with another selector, that will be evaluated too, and so on. So if this function returns TRUE, it means that all child selectors are also matches.
public combine ( DOMNode $node, array $selectors, integer $index )
$node DOMNode The DOMNode to test.
$selectors array The array of simple selectors.
$index integer The index of the current selector.
    public function combine($node, $selectors, $index)
    {
        $selector = $selectors[$index];
        //$this->debug(implode(' ', $selectors));
        switch ($selector->combinator) {
            case SimpleSelector::adjacent:
                return $this->combineAdjacent($node, $selectors, $index);
            case SimpleSelector::sibling:
                return $this->combineSibling($node, $selectors, $index);
            case SimpleSelector::directDescendant:
                return $this->combineDirectDescendant($node, $selectors, $index);
            case SimpleSelector::anyDescendant:
                return $this->combineAnyDescendant($node, $selectors, $index);
            case SimpleSelector::anotherSelector:
                // fprintf(STDOUT, "Next selector: %s\n", $selectors[$index]);
                return $this->matchesSimpleSelector($node, $selectors, $index);
        }
        return false;
    }