final class EvidenceMatcher

Resolves an evidence entry to the one unit of its item's scope that it quotes completely.

Methods§

public function __construct(
    private Registry $registry,
    private string $directory,
    private bool $live,
)

Parameters

$registryRegistryThe source extensions of the project
$directorystringThe configuration directory
$liveboolWhether to read the current source URIs instead of pinned snapshots
public function match(
    Source $source,
    Excerpt $excerpt,
    array<string, list<string>> $scopes,
): string

Resolves one evidence entry.

Parameters

$sourceSourceThe source of the item quoting it
$excerptExcerptThe evidence entry
$scopesarray<string, list<string>>The unit keys of each scope by source ID

Returns

string The key of the quoted unit

Throws

InvalidInputException When the item's source format has no extension
RuntimeException When the selector matches no or several units, lies outside the scope or the quotation differs
Test cases 8
Called from 1
Calls 5

Private surface 3§

Implementation details, listed for orientation only.

private Registry $registry
private string $directory
private bool $live

Test cases 16§

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 8

Relations§

Instantiated in 1
Method calls 1