classQuotationBlocks
final class QuotationBlocks
Reads the evidence quotations that follow a card's statement.
Each block quotation may be followed by a paragraph holding only its source link.
Methods§
public function __construct(private Presentation $presentation, private Citation|null $source)Parameters
$presentation | Presentation | Receives the citation link of each quotation |
$source | Citation|null | Resolves citations against the definition's source |
public function read(
list<Node> $blocks,
string $file,
string $id,
): array{list<stdClass>, list<Node>}Reads the leading quotations of the remaining card blocks.
Parameters
$blocks | list<Node> | The blocks after the statement |
$file | string | The definition file |
$id | string | The item ID |
Returns
array{list<stdClass>, list<Node>} The evidence entries and the blocks after themThrows
InvalidInputException When a quotation lacks a source, a selector or text, or its citation disagreesTest cases 6
QuotationBlocksTest::testReadLeavesAParagraphWithMoreThanALinkAfterTheQuotationcallsQuotationBlocksTest::testReadLeavesBlocksWithoutQuotationsUnchangedcallsQuotationBlocksTest::testReadPrefixesTheErrorsWithTheFileAndItemcallsQuotationBlocksTest::testReadReadsTheLeadingQuotationsAndTheirAttributionscallsQuotationBlocksTest::testReadRejectsAnAttributionWithAnEmptyDestinationcallsQuotationBlocksTest::testReadRejectsTwoSourceCitationscalls
Called from 1
Calls 5
- function-call
array_shiftline 45 - static-call Nodes::link() line 48
- new Quotation line 51
- method-call Quotation::read() line 53
- new InvalidInputException line 55
Private surface 2§
Implementation details, listed for orientation only.
private Presentation $presentationprivate Citation|null $sourceTest cases 13§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
QuotationBlocksTest::testReadLeavesAParagraphWithMoreThanALinkAfterTheQuotationcallsQuotationBlocksTest::testReadLeavesBlocksWithoutQuotationsUnchangedcallsQuotationBlocksTest::testReadPrefixesTheErrorsWithTheFileAndItemcallsQuotationBlocksTest::testReadReadsTheLeadingQuotationsAndTheirAttributionscallsQuotationBlocksTest::testReadRejectsAnAttributionWithAnEmptyDestinationcallsQuotationBlocksTest::testReadRejectsTwoSourceCitationscalls
Other tests reaching this symbol 7
DefinitionReaderTestcallsDocumentReaderTestcallsLoaderTestcallsCardReaderTestcallsReferenceTestcallsMarkdownDocumentTestcallsFormatterTestcalls