Class FilenameFilterIterator
Filters files by filename using glob patterns.
Supports glob patterns like:
*.php- All PHP filesTest*.php- Files starting with Test{foo,bar}.php- foo.php or bar.php
Can be used to include or exclude files based on the $negate parameter:
- When $negate is false (default): includes files matching patterns
- When $negate is true: excludes files matching patterns
Method Summary
-
__construct() public
-
accept() public
Method Detail
__construct() ¶ public
__construct(Iterator<mixed, \SplFileInfo> $iterator, array<string> $patterns, bool $negate = false)
Parameters
-
Iterator<mixed, \SplFileInfo>$iterator The iterator to filter
-
array<string>$patterns Glob patterns to match against
-
bool$negate optional When true, inverts the filter (excludes matching files)