classFieldSections
final class FieldSections
Reads the bold field sections that end a card, such as tests or reason.
"unsupport reason", "unsupported reason" and "rationale" are spellings of the reason field.
Methods§
public function __construct(private Presentation $presentation)Parameters
$presentation | Presentation | Receives the link targets, label badges and references of each field |
public function read(stdClass $item, list<Node> $blocks, string $file, string $id): voidReads every field section of a card.
Parameters
$item | stdClass | The item being read |
$blocks | list<Node> | The blocks after the evidence quotations |
$file | string | The definition file |
$id | string | The item ID |
Throws
InvalidInputException When content precedes the first field heading or a field is malformed or repeatedTest cases 6
FieldSectionsTest::testReadAcceptsTheSpellingsOfTheReasonFieldcallsFieldSectionsTest::testReadReadsEveryFieldSectioncallsFieldSectionsTest::testReadReadsNothingFromNoBlockscallsFieldSectionsTest::testReadRejectsMalformedSectionscallsFieldSectionsTest::testReadRemembersLabelBadgescallsFieldSectionsTest::testReadRemembersLinksAndReferencescalls
Called from 1
Calls 3
- static-call Nodes::field() line 40
- method-call FieldSections::assign() line 43
- new InvalidInputException line 51
public function assign(
stdClass $item,
string $name,
list<Node> $nodes,
string $file,
string $id,
): voidReads one field section into the item.
Parameters
$item | stdClass | The item being read |
$name | string | The field name |
$nodes | list<Node> | The blocks of the section |
$file | string | The definition file |
$id | string | The item ID |
Throws
InvalidInputException When the field repeats or its value is malformedTest cases 3
Called from 2
Calls 5
- function-call
property_existsline 74 - new InvalidInputException line 75
- new FieldReader line 77
- method-call FieldReader::read() line 79
- new Reference line 85
Private surface 1§
Implementation details, listed for orientation only.
private Presentation $presentationTest cases 16§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 9
FieldSectionsTest::testAssignKeepsTheCauseOfAMalformedValuecallsFieldSectionsTest::testAssignReadsOneFieldIntoTheItemcallsFieldSectionsTest::testAssignRejectsAFieldTheItemAlreadyHascallsFieldSectionsTest::testReadAcceptsTheSpellingsOfTheReasonFieldcallsFieldSectionsTest::testReadReadsEveryFieldSectioncallsFieldSectionsTest::testReadReadsNothingFromNoBlockscallsFieldSectionsTest::testReadRejectsMalformedSectionscallsFieldSectionsTest::testReadRemembersLabelBadgescallsFieldSectionsTest::testReadRemembersLinksAndReferencescalls
Other tests reaching this symbol 7
DefinitionReaderTestcallsDocumentReaderTestcallsLoaderTestcallsCardReaderTestcallsReferenceTestcallsMarkdownDocumentTestcallsFormatterTestcalls