Documentation

MultiplePcreFilterIterator extends FilterIterator
in package

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

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

$matchRegexps  : mixed
$noMatchRegexps  : mixed
__construct()  : mixed
rewind()  : mixed
This is a workaround for the problem with \FilterIterator leaving inner \FilesystemIterator in wrong state after rewind in some cases.
isAccepted()  : bool
Checks whether the string is accepted by the regex filters.
isRegex()  : bool
Checks whether the string is a regex.
toRegex()  : string
Converts string into regexp.

Properties

Methods

__construct()

public __construct(Iterator $iterator, array<string|int, mixed> $matchPatterns, array<string|int, mixed> $noMatchPatterns) : mixed
Parameters
$iterator : Iterator

The Iterator to filter

$matchPatterns : array<string|int, mixed>

An array of patterns that need to match

$noMatchPatterns : array<string|int, mixed>

An array of patterns that need to not match

Return values
mixed

rewind()

This is a workaround for the problem with \FilterIterator leaving inner \FilesystemIterator in wrong state after rewind in some cases.

public rewind() : mixed
Tags
see
FilterIterator::rewind()
Return values
mixed

isAccepted()

Checks whether the string is accepted by the regex filters.

protected isAccepted(string $string) : bool

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.

Parameters
$string : string

The string to be matched against filters

Return values
bool

isRegex()

Checks whether the string is a regex.

protected isRegex(string $str) : bool
Parameters
$str : string
Return values
bool

Whether the given string is a regex

toRegex()

Converts string into regexp.

protected abstract toRegex(string $str) : string
Parameters
$str : string

Pattern

Return values
string

regexp corresponding to a given string

Search results