Abstract Class Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator

InheritanceSymfony\Component\Finder\Iterator\MultiplePcreFilterIterator » Symfony\Component\Finder\Iterator\FilterIterator » FilterIterator
SubclassesSymfony\Component\Finder\Iterator\FilecontentFilterIterator, Symfony\Component\Finder\Iterator\FilenameFilterIterator, Symfony\Component\Finder\Iterator\PathFilterIterator

MultiplePcreFilterIterator filters files using patterns (regexps, globs or strings).

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Constructor. Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator
rewind() This is a workaround for the problem with \FilterIterator leaving inner \FilesystemIterator in wrong state after rewind in some cases. Symfony\Component\Finder\Iterator\FilterIterator

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
isAccepted() Checks whether the string is accepted by the regex filters. Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator
isRegex() Checks whether the string is a regex. Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator
toRegex() Converts string into regexp. Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator

Property Details

$matchRegexps protected property
protected $matchRegexps = []
$noMatchRegexps protected property
protected $noMatchRegexps = []

Method Details

__construct() public method

Constructor.

public void __construct ( Iterator $iterator, array $matchPatterns, array $noMatchPatterns )
$iterator Iterator

The Iterator to filter

$matchPatterns array

An array of patterns that need to match

$noMatchPatterns array

An array of patterns that need to not match

isAccepted() protected method

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.

protected bool isAccepted ( $string )
$string string

The string to be matched against filters

isRegex() protected method

Checks whether the string is a regex.

protected bool isRegex ( $str )
$str string
return bool

Whether the given string is a regex

toRegex() protected abstract method

Converts string into regexp.

protected abstract string toRegex ( $str )
$str string

Pattern

return string

Regexp corresponding to a given string