public function QueryPath::even in QueryPath 6
Same name and namespace in other branches
- 7.3 QueryPath/QueryPath.php \QueryPath::even()
- 7.2 QueryPath/QueryPath.php \QueryPath::even()
File
- QueryPath/
QueryPath.php, line 1652
Class
Code
public function even() {
$found = new SplObjectStorage();
$even = false;
foreach ($this->matches as $m) {
if ($even && $m->nodeType == XML_ELEMENT_NODE) {
$found
->attach($m);
}
$even = $even ? false : true;
}
$this
->setMatches($found);
$this->matches = $found;
return $this;
}