CustomFilterIterator
extends FilterIterator
in package
CustomFilterIterator filters files by applying anonymous functions.
The anonymous function receives a \SplFileInfo and must return false to remove files.
Tags
Table of Contents
Properties
- $filters : mixed
Methods
- __construct() : mixed
- Constructor.
- accept() : bool
- Filters the iterator values.
- rewind() : mixed
- This is a workaround for the problem with \FilterIterator leaving inner \FilesystemIterator in wrong state after rewind in some cases.
Properties
$filters
private
mixed
$filters
= array()
Methods
__construct()
Constructor.
public
__construct(Iterator $iterator, array<string|int, callable> $filters) : mixed
Parameters
- $iterator : Iterator
-
The Iterator to filter
- $filters : array<string|int, callable>
-
An array of PHP callbacks
Tags
accept()
Filters the iterator values.
public
accept() : bool
Return values
bool —true if the value should be kept, false otherwise
rewind()
This is a workaround for the problem with \FilterIterator leaving inner \FilesystemIterator in wrong state after rewind in some cases.
public
rewind() : mixed