QueryPath\DOMQuery::nextAll PHP Method

nextAll() public method

For each element in the DOMQuery, get all siblings that appear after it. If a selector is passed in, then only siblings that match the selector will be included.
See also: next()
See also: prevAll()
See also: children()
See also: siblings()
public nextAll ( string $selector = null )
$selector string A valid CSS 3 selector.
    public function nextAll($selector = null)
    {
        $found = new \SplObjectStorage();
        foreach ($this->matches as $m) {
            while (isset($m->nextSibling)) {
                $m = $m->nextSibling;
                if ($m->nodeType === XML_ELEMENT_NODE) {
                    if (!empty($selector)) {
                        if (QueryPath::with($m, null, $this->options)->is($selector) > 0) {
                            $found->attach($m);
                        }
                    } else {
                        $found->attach($m);
                    }
                }
            }
        }
        return $this->inst($found, null, $this->options);
    }