\Symfony\Component\Finder\IteratorPathFilterIterator

PathFilterIterator filters files by path patterns (e.g. some/special/dir).

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 strings to regexp.

PCRE patterns are left unchanged.

Default conversion: 'lorem/ipsum/dolor' ==> 'lorem/ipsum/dolor/'

Use only / as directory separator (on Windows also).

Parameters

string $str

Pattern: regexp or dirname

Returns

string —