class PathFilterIterator extends MultiplePcreFilterIterator
PathFilterIterator filters files by path patterns (e.g. some/special/dir).
protected | $matchRegexps | from MultiplePcreFilterIterator | |
protected | $noMatchRegexps | from MultiplePcreFilterIterator |
__construct(Iterator $iterator, array $matchPatterns, array $noMatchPatterns) | from MultiplePcreFilterIterator | |
bool | isAccepted(string $string) Checks whether the string is accepted by the regex filters. | from MultiplePcreFilterIterator |
bool | isRegex(string $str) Checks whether the string is a regex. | from MultiplePcreFilterIterator |
string | toRegex(string $str) Converts strings to regexp. | |
bool | accept() Filters the iterator values. |
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 |
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.
string | $string | The string to be matched against filters |
bool |
Checks whether the string is a regex.
string | $str |
bool | Whether the given string is a regex |
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).
string | $str | Pattern |
string | regexp corresponding to a given string |
Filters the iterator values.
bool | true if the value should be kept, false otherwise |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Finder/Iterator/PathFilterIterator.html