final class Quotation

Reads and writes one evidence quotation of a card.

A quotation may start with a selector comment and end with a paragraph holding its source link; its other paragraphs are the quoted text.

Properties§

Methods§

public function read(
    BlockQuote $node,
    Citation|null $citation,
    Link|null $attribution = null,
): stdClass

Reads a quotation.

Parameters

$nodeBlockQuoteThe block quotation
$citationCitation|nullResolves the citation against the definition's source
$attributionLink|nullThe source link written after the quotation, if any

Returns

stdClass The evidence entry with its selector and quote

Throws

InvalidInputException When the definition has no source, the quotation is malformed or no selector is given
Test cases 7
Called from 1
Calls 8
public static function annotation(HtmlBlock $node): string

Reads the selector comment that may start a quotation.

Parameters

$nodeHtmlBlockThe HTML block

Returns

string The selector

Throws

InvalidInputException When the block is anything but a single selector comment
Test cases 2
Called from 2
Calls 9
public static function render(
    string $selector,
    string $quote,
    Citation|null $citation,
    array{url: string, label: string}|null $link,
): string

Writes a quotation, with a selector comment unless the citation link identifies the unit.

Parameters

$selectorstringThe selector
$quotestringThe quoted text
$citationCitation|nullCreates the citation link
$linkarray{url: string, label: string}|nullThe citation link read with the quotation

Returns

string The Markdown quotation
Test cases 4
Called from 1
Calls 4

Test cases 19§

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

Dedicated tests 13
Other tests reaching this symbol 6

Relations§

Instantiated in 1
Static calls 2
Method calls 1