final class SourceScanner
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

Finds the PHP files under the paths a run was pointed at.

Constants§

public const SKIPPED = ['vendor', 'node_modules', '.git', 'build']

The directory names skipped unless a path names one directly.

Methods§

public function __construct(string $root, list<string> $excluded = [])

Parameters

$rootstringThe directory reported paths are relative to
$excludedlist<string>Patterns, matched against the reported path, to leave out
Calls 1
public function scan(list<string> $paths): list<SourceFile>

The files under the given paths, in a stable order.

Parameters

$pathslist<string>

Returns

Throws

SourceScanException When a path does not exist or cannot be read
Test cases 2
Called from 1
Calls 3
public function scanOne(string $path): list<SourceFile>

The files under one path.

Parameters

$pathstring

Returns

Throws

SourceScanException When the path does not exist or cannot be read
Test cases 2
Called from 1
Calls 5
public function walk(string $directory): list<string>

Every PHP file under a directory, skipping the directories a scan never wants.

Parameters

$directorystring

Returns

list<string>
Test cases 1
Called from 1
Calls 9
public function read(string $path): ?SourceFile
public function isExcluded(string $reported): bool

Whether a reported path matches one of the exclusion patterns.

Parameters

$reportedstring

Returns

bool
Test cases 1
Called from 1
Calls 3
public function relative(string $path): string

The path as the catalog reports it.

Parameters

$pathstring

Returns

string
Test cases 1
Called from 1
Calls 4

Private surface 2§

Implementation details, listed for orientation only.

private string $root
private list<string> $excluded

Test cases 11§

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

Dedicated tests 9
Other tests reaching this symbol 2

Relations§

Instantiated in 1
Method calls 1