public function each($callback)
{
if (is_callable($callback)) {
$i = 0;
foreach ($this->matches as $item) {
if (call_user_func($callback, $i, $item) === false) {
return $this;
}
++$i;
}
} else {
throw new \QueryPath\Exception('Callback is not callable.');
}
return $this;
}