\Symfony\Component\Finder\IteratorFilenameFilterIterator

FilenameFilterIterator filters files by patterns (a regexp, a glob, or a string).

Summary

Methods
Properties
Constants
__construct()
accept()
No public properties found
No constants found
isAccepted()
isRegex()
toRegex()
$matchRegexps
$noMatchRegexps
N/A
No private methods found
No private properties found
N/A

Properties

$matchRegexps

$matchRegexps

$noMatchRegexps

$noMatchRegexps

Methods

__construct()

__construct(\Iterator  $iterator, string[]  $matchPatterns, string[]  $noMatchPatterns) : mixed

Parameters

\Iterator $iterator

The Iterator to filter

string[] $matchPatterns

An array of patterns that need to match

string[] $noMatchPatterns

An array of patterns that need to not match

Returns

mixed —

accept()

accept() : bool

Filters the iterator values.

Returns

bool —

isAccepted()

isAccepted(string  $string) : bool

Checks whether the string is accepted by the regex filters.

If there is no regexps defined in the class, this method will accept the string. Such case can be handled by child classes before calling the method if they want to apply a different behavior.

Parameters

string $string

Returns

bool —

isRegex()

isRegex(string  $str) : bool

Checks whether the string is a regex.

Parameters

string $str

Returns

bool —

toRegex()

toRegex(string  $str) : string

Converts glob to regexp.

PCRE patterns are left unchanged. Glob strings are transformed with Glob::toRegex().

Parameters

string $str

Pattern: glob or regexp

Returns

string —