Class Symfony\Component\Finder\Iterator\FilenameFilterIterator

InheritanceSymfony\Component\Finder\Iterator\FilenameFilterIterator » Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator » Symfony\Component\Finder\Iterator\FilterIterator » FilterIterator

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

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Constructor. Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator
accept() Filters the iterator values. Symfony\Component\Finder\Iterator\FilenameFilterIterator
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 glob to regexp. Symfony\Component\Finder\Iterator\FilenameFilterIterator

Method Details

accept() public method

Filters the iterator values.

public bool accept ( )
return bool

True if the value should be kept, false otherwise

toRegex() protected method

Converts glob to regexp.

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

protected string toRegex ( $str )
$str string

Pattern: glob or regexp

return string

Regexp corresponding to a given glob or regexp