classExcerpt
final class Excerpt
One piece of evidence: a quotation and the selector of the source unit it quotes.
The quotation must equal the complete text of the selected unit.
Properties§
public string $selectorpublic string $quoteMethods§
public function __construct(public string $selector, public string $quote)Parameters
$selector | string | Identifies exactly one unit of the item's source |
$quote | string | The complete text of that unit |
public static function from(mixed $value): selfReads an evidence entry of a definition.
Parameters
$value | mixed | The decoded evidence entry |
Returns
self The excerptThrows
InvalidInputException When the entry has unknown fields or lacks a selector or quoteTest cases 2
Called from 1
Calls 4
- static-call Fields::mapping() line 36
- static-call Fields::keys() line 37
- new
selfline 38 - static-call Fields::text() line 38
Test cases 28§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 26
DefinitionReaderTestcallsLoaderTestcallsReferenceTestcallsMarkdownDocumentTestcallsApplicationTestcallsCommandHandlerTestcallsCommandLineTestcallsExecutorTestcallsFormatterTestcallsItemTest::testFromReadsASpecificationWithDefaultscallsItemValidatorTest::providerDispositionAcceptsItemscallsItemValidatorTest::providerDispositionRejectsItemscallsItemValidatorTest::providerValidateAcceptsItemscallsItemValidatorTest::providerValidateReportsTheFirstBrokenRulecallsAnalyzerTest::testAnalyzeReadsPinnedSnapshotsUnlessLivecallsCoverageTestcallsEvidenceMatcherTest::testMatchReadsTheSnapshotUnlessLivecallsEvidenceMatcherTest::testMatchRejectsAnUnknownFormatcallsEvidenceMatcherTest::testMatchRejectsAPartialQuotationcallsEvidenceMatcherTest::testMatchRejectsASelectorMatchingNoUnitcallsEvidenceMatcherTest::testMatchRejectsASelectorMatchingSeveralUnitscallsEvidenceMatcherTest::testMatchRejectsAUnitOutsideTheScopecallsEvidenceMatcherTest::testMatchRejectsTheTextOfTheOtherReadingModecallsEvidenceMatcherTest::testMatchReturnsTheKeyOfTheQuotedUnitcallsSnapshotTestcallsVerifierTestcalls