src/Collection/FilesCollection.php
public function filter(Closure $closure): self
    {
        $filter = new Iterator\CustomFilterIterator($this->getIterator(), [$closure]);

        return new self(iterator_to_array($filter));
    }
public function filter(Closure $closure): self
    {
        $filter = new Iterator\CustomFilterIterator($this->getIterator(), [$closure]);

        return new self(iterator_to_array($filter));
    }
public function filter ( Closure $ closure ) : self { $ filter = new Iterator \ CustomFilterIterator ( $ this -> getIterator ( ) , [ $ closure ] ) ; return new self ( iterator_to_array ( $ filter ) ) ; }
Filters the iterator with an anonymous function.

The anonymous function receives a \SplFileInfo and must return false
to remove files.



@see CustomFilterIterator
Filters the iterator with an anonymous function .