class Finder

Finder.

Properties

protected array $paths The paths that we should search.
protected string $pattern The pattern that the files should match.
protected int $maxDepth Maximum search depth.

Methods

__construct(array $paths)

Constructor.

$this
setPattern(string $pattern)

Sets a pattern that the files should match.

string|null
getPattern()

Returns the pattern that the files should match.

$this
setMaxDepth(int $maxDepth)

Sets the maximum search depth.

int|null
getMaxDepth()

Returns the the maximum search depth.

createIterator(string $path)

Creates an iterator instance.

find()

Finds all files in the given paths.

findAs(string $className)

Finds all files in the given paths.

Details

at line 48
__construct(array $paths)

Constructor.

Parameters

array $paths The paths that we should search

at line 59
$this setPattern(string $pattern)

Sets a pattern that the files should match.

Parameters

string $pattern

Return Value

$this

at line 71
string|null getPattern()

Returns the pattern that the files should match.

Return Value

string|null

at line 82
$this setMaxDepth(int $maxDepth)

Sets the maximum search depth.

Parameters

int $maxDepth

Return Value

$this

at line 94
int|null getMaxDepth()

Returns the the maximum search depth.

Return Value

int|null

at line 105
protected Iterator createIterator(string $path)

Creates an iterator instance.

Parameters

string $path

Return Value

Iterator

at line 127
Generator find()

Finds all files in the given paths.

Return Value

Generator

at line 141
Generator findAs(string $className)

Finds all files in the given paths.

Parameters

string $className Class name

Return Value

Generator