classEvidenceMatcher
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
$registry | Registry | The source extensions of the project |
$directory | string | The configuration directory |
$live | bool | Whether to read the current source URIs instead of pinned snapshots |
public function match(
Source $source,
Excerpt $excerpt,
array<string, list<string>> $scopes,
): stringResolves one evidence entry.
Parameters
Returns
string The key of the quoted unitThrows
InvalidInputException When the item's source format has no extensionRuntimeException When the selector matches no or several units, lies outside the scope or the quotation differsTest cases 8
EvidenceMatcherTest::testMatchReadsTheSnapshotUnlessLivecallsEvidenceMatcherTest::testMatchRejectsAnUnknownFormatcallsEvidenceMatcherTest::testMatchRejectsAPartialQuotationcallsEvidenceMatcherTest::testMatchRejectsASelectorMatchingNoUnitcallsEvidenceMatcherTest::testMatchRejectsASelectorMatchingSeveralUnitscallsEvidenceMatcherTest::testMatchRejectsAUnitOutsideTheScopecallsEvidenceMatcherTest::testMatchRejectsTheTextOfTheOtherReadingModecallsEvidenceMatcherTest::testMatchReturnsTheKeyOfTheQuotedUnitcalls
Called from 1
Calls 5
- method-call Registry::get() line 42
- function-call
countline 43 - new
RuntimeExceptionline 44 - function-call
in_arrayline 47 - static-call Unit::normalize() line 50
Private surface 3§
Implementation details, listed for orientation only.
private Registry $registryprivate string $directoryprivate bool $liveTest cases 16§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 8
EvidenceMatcherTest::testMatchReadsTheSnapshotUnlessLivecallsEvidenceMatcherTest::testMatchRejectsAnUnknownFormatcallsEvidenceMatcherTest::testMatchRejectsAPartialQuotationcallsEvidenceMatcherTest::testMatchRejectsASelectorMatchingNoUnitcallsEvidenceMatcherTest::testMatchRejectsASelectorMatchingSeveralUnitscallsEvidenceMatcherTest::testMatchRejectsAUnitOutsideTheScopecallsEvidenceMatcherTest::testMatchRejectsTheTextOfTheOtherReadingModecallsEvidenceMatcherTest::testMatchReturnsTheKeyOfTheQuotedUnitcalls
Other tests reaching this symbol 8
MarkdownDocumentTestcallsApplicationTestcallsCommandHandlerTestcallsExecutorTestcallsAnalyzerTestcallsCoverageTestcallsSnapshotTestcallsVerifierTestcalls