QueryPath\DOMQuery::next PHP Метод

next() публичный Метод

If a selector is provided, the next matching sibling will be returned.
См. также: nextAll()
См. также: prev()
См. также: children()
См. также: contents()
См. также: parent()
См. также: parents()
public next ( string $selector = null )
$selector string A CSS3 selector.
    public function next($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);
                            break;
                        }
                    } else {
                        $found->attach($m);
                        break;
                    }
                }
            }
        }
        return $this->inst($found, null, $this->options);
    }