final class Finder
Public API: explicitly declared with @visibility public.

Finds local file paths without reading or parsing their contents. Patterns match paths relative to each root: * and ? stay within a component. The recursive ** wildcard crosses directories and can match zero directories. Exclusions win. Linked files and directories are skipped. With no roots, searches the current directory; with no includes, selects every regular file. No directories are excluded implicitly.

Selecting only PHP source pathsdoctest
$finder = (new \Deriver\Finder())->in(__DIR__)->include('*.php')->exclude('vendor');
    is_array($finder->files()) // => true

Methods§

public function include(string $pattern, string ...$patterns): self

Includes files matching any supplied root-relative wildcard pattern.

Parameters

$patternstring
$patternsstring

Returns

self
Test cases 1
Called from 1
Calls 1
public function exclude(string $pattern, string ...$patterns): self

Excludes matching files and directory subtrees, even when included explicitly.

Parameters

$patternstring
$patternsstring

Returns

self
Called from 1
Calls 1
public function files(): list<string>

Enumerates paths only; file contents are read later by Deriver::prepare().

Returns

list<string> Sorted, unique absolute paths
Test cases 1
Called from 1
Calls 7

Private surface 3§

Implementation details, listed for orientation only.

private list<string> $directories = []
private list<PathPattern> $includes = []
private list<PathPattern> $excludes = []

Test cases 12§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 8
Other tests reaching this symbol 4

Relations§

Instantiated in 1
Method calls 4