Class Symfony\Component\Finder\Iterator\CustomFilterIterator

InheritanceSymfony\Component\Finder\Iterator\CustomFilterIterator » Symfony\Component\Finder\Iterator\FilterIterator » FilterIterator

CustomFilterIterator filters files by applying anonymous functions.

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

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Constructor. Symfony\Component\Finder\Iterator\CustomFilterIterator
accept() Filters the iterator values. Symfony\Component\Finder\Iterator\CustomFilterIterator
rewind() This is a workaround for the problem with \FilterIterator leaving inner \FilesystemIterator in wrong state after rewind in some cases. Symfony\Component\Finder\Iterator\FilterIterator

Method Details

__construct() public method


public void __construct ( Iterator $iterator, array $filters )
$iterator Iterator

The Iterator to filter

$filters callable[]

An array of PHP callbacks

throws InvalidArgumentException
accept() public method

Filters the iterator values.

public bool accept ( )
return bool

True if the value should be kept, false otherwise