4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 class CallbackFilterIterator extends FilterIterator
17 public function __construct(Iterator $iterator, $callback)
19 $this->iterator = $iterator;
20 $this->callback = $callback;
21 parent::__construct($iterator);
24 public function accept()
26 return call_user_func($this->callback, $this->current(), $this->key(), $this->iterator);