classSectionBlocks
final class SectionBlocks
Checks the blocks of one item section against the ordered block entries of the profile.
Each block matches the first entry, at or after the previous match, whose kinds and text constraint it satisfies; every entry must then occur as often as it allows.
Methods§
public static function check(
list<Node> $nodes,
array<string, mixed> $schema,
string $file,
): voidChecks the blocks of a section.
Parameters
$nodes | list<Node> | The blocks under one heading |
$schema | array<string, mixed> | The profile's section |
$file | string | The definition file |
Throws
InvalidInputException When a block matches no entry where none is allowed, or an entry occurs too often or too rarelyTest cases 4
Called from 2
Calls 13
- static-call Fields::sequence() line 33
- static-call Fields::mapping() line 34
- function-call
array_fillline 36 - function-call
countline 36 - static-call Fields::keys() line 42
- function-call
is_stringline 43 - static-call Fields::strings() line 43
- function-call
in_arrayline 44 - static-call BlockKind::of() line 44
- static-call TextConstraint::matches() line 44
- static-call Nodes::text() line 44
- new InvalidInputException line 52
- static-call Occurrences::check() line 56
Test cases 11§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
Other tests reaching this symbol 7
DefinitionReaderTestcallsDocumentReaderTestcallsLoaderTestcallsDocumentSchemaTestcallsReferenceTestcallsMarkdownDocumentTestcallsFormatterTestcalls