final class FieldReader

Reads the value of one bold field section of a card.

Prose fields are paragraphs; list fields are bullet lists, or "None." for an empty list; labels may also be a paragraph of badge images. Link targets and label badge images are kept so that writing the card back reproduces them.

Properties§

public array<string, string> $badges = []

Methods§

public function read(string $name, list<Node> $nodes): mixed
public function prose(list<Node> $nodes): string

Reads prose paragraphs, separated by blank lines.

Parameters

$nodeslist<Node>The blocks

Returns

string The text

Throws

InvalidInputException When a block is not a paragraph or has unsupported inline Markdown
Test cases 2
Called from 2
Calls 3
public function evidence(Node $node): list<stdClass>

Reads an evidence list of bold selector fields, each followed by one block quotation.

Parameters

$nodeNodeThe list

Returns

list<stdClass> The evidence entries

Throws

InvalidInputException When an entry lacks its selector or quotation
Test cases 2
Called from 1
Calls 4
public function tests(Node $node): list<stdClass>

Reads a tests list of "**runner:** target" entries.

Parameters

$nodeNodeThe list

Returns

list<stdClass> The test references

Throws

InvalidInputException When an entry is not a bold runner and a target
Test cases 3
Called from 1
Calls 5
public function references(Node $node): list<string>

Reads a list of links to other items and remembers their targets.

Parameters

$nodeNodeThe list

Returns

list<string> The linked item IDs

Throws

InvalidInputException When an entry is not a single link
Test cases 2
Called from 1
Calls 4
public function labels(Node $node): list<string>

Reads labels from a bullet list or a paragraph of badge images.

Parameters

$nodeNodeThe list or paragraph

Returns

list<string> The labels

Throws

InvalidInputException When the paragraph holds anything but badge images or no labels
Test cases 4
Called from 1
Calls 7
public function design(Node $node): list<stdClass>

Reads design references: links with optional text, or plain text.

Parameters

$nodeNodeThe list

Returns

list<stdClass> The design references

Throws

InvalidInputException When an entry is not a single paragraph
Test cases 2
Called from 1
Calls 4

Test cases 30§

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

Dedicated tests 22
Other tests reaching this symbol 8

Relations§

Instantiated in 1
Method calls 1