\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 : 

Type

$noMatchRegexps

$noMatchRegexps : 

Type

Methods

__construct()

__construct(\Iterator  $iterator, array  $matchPatterns, array  $noMatchPatterns) 

Parameters

\Iterator $iterator

The Iterator to filter

array $matchPatterns

An array of patterns that need to match

array $noMatchPatterns

An array of patterns that need to not match

accept()

accept() : boolean

Filters the iterator values.

Returns

boolean —

true if the value should be kept, false otherwise

isAccepted()

isAccepted(string  $string) : boolean

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

The string to be matched against filters

Returns

boolean

isRegex()

isRegex(string  $str) : boolean

Checks whether the string is a regex.

Parameters

string $str

Returns

boolean —

Whether the given string is a regex

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 —

regexp corresponding to a given string or regexp