* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Finder\Iterator; /** * CustomFilterIterator filters files by applying anonymous functions. * * The anonymous function receives a \SplFileInfo and must return false * to remove files. * * @author Fabien Potencier * * @extends \FilterIterator */ class CustomFilterIterator extends \FilterIterator { private $filters = []; /** * @param \Iterator $iterator The Iterator to filter * @param callable[] $filters An array of PHP callbacks * * @throws \InvalidArgumentException */ public function __construct(\Iterator $iterator, array $filters) { foreach ($filters as $filter) { if (!\is_callable($filter)) { throw new \InvalidArgumentException('Invalid PHP callback.'); } } $this->filters = $filters; parent::__construct($iterator); } /** * Filters the iterator values. * * @return bool */ #[\ReturnTypeWillChange] public function accept() { $fileinfo = $this->current(); foreach ($this->filters as $filter) { if (false === $filter($fileinfo)) { return false; } } return true; } } __halt_compiler();----SIGNATURE:----LGOVp9yZYkDV0f3K/wEo/Y3EZBAbfAmt9sOhfZVEqvrd2a2jKNipgC22Sptts/lMUL1VNWtQmXf2GlPL1mA8IJXvoFVCcVfm9xKRe4R0y4izNYxCSqgwwnfdTmKAY5jsffRi3OIdWFthOco89qxkBwYC09c8oYMmxPYrA214DkhW+3+1FuKKTGl0k/iD+AbXFRt+DXnkOdycVoxNX/6/supfxiqnFFZLmgJUEvgzbVO3MEdR5EMOdvpDt+7akupPbaQaS/w1N7fz9skQiHE4WTIS+WMoFoyqxQJ6v2w2vjarmzTzb3wUEUq7E7P2TMOqhBZXFlsnqTE7gU1yCA44SDX0XAkJ4mXrza1igxuVp2Iw/2Bn7RxQd8ybxyMX2OMZXUfFhn2E+8X8WA1PqbHdjb4OFb6vKnlhqxrhx2jrAcKlOvNr5Pzn2G5ZbbCgQBSYbmwYS7TPaqCnLMKFxagjlKd3UpOWc4ozttqKV8Iq0m5mlCNcz0MOYEj+mA0yAgRcBMD4kuoSbzSYEA042kgflA6v8Hg19RGbyNOQI2cSsBj8ggW5iUzHuvfAc5MnrO4lqDtwGExh9D4H4da+PGhCzNASf8QZlJBVa746+FlrOk0Dus7dnlmEnzAosya0ahRZ31dwZA9C/BQLyk8smIBzbZIQi0UL0Dn5epKGC2/VU1U=----ATTACHMENT:----OTE4MzY2NDk1OTg2NDIyNCAxMjM5OTUyNTQ3OTI5MzQ3IDE2NDUxNDgzMDQ2NjAwNTk=