Class Symfony\Component\Finder\Iterator\PathFilterIterator

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

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

Public Methods

Hide inherited methods

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

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

PCRE patterns are left unchanged.

Default conversion:

'lorem/ipsum/dolor' ==>  'lorem\/ipsum\/dolor/'

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

protected string toRegex ( $str )
$str string

Pattern: regexp or dirname

return string

Regexp corresponding to a given string or regexp