Class Symfony\Component\Finder\Iterator\FilecontentFilterIterator

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

FilecontentFilterIterator filters files by their contents using patterns (regexps or strings).

Public Methods

Hide inherited methods

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

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 string to regexp if necessary.

protected string toRegex ( $str )
$str string

Pattern: string or regexp

return string

Regexp corresponding to a given string or regexp