public function QueryPath::nextUntil in QueryPath 6
Same name and namespace in other branches
- 7.3 QueryPath/QueryPath.php \QueryPath::nextUntil()
- 7.2 QueryPath/QueryPath.php \QueryPath::nextUntil()
File
- QueryPath/
QueryPath.php, line 1749
Class
Code
public function nextUntil($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 (qp($m, NULL, $this->options)
->is($selector) > 0) {
break;
}
else {
$found
->attach($m);
}
}
else {
$found
->attach($m);
}
}
}
}
$this
->setMatches($found);
return $this;
}