classDocumentSchema
final class DocumentSchema
Evaluates the bundled document-schema profile; it is not a general dialect implementation.
The profile constrains the frontmatter, requires one repeating item section per top-level heading and lists the blocks a section may contain.
Methods§
public function validate(Document $document, stdClass $frontmatter, string $file): voidChecks a parsed Markdown definition against the bundled profile.
Parameters
$document | Document | The parsed body |
$frontmatter | stdClass | The frontmatter |
$file | string | The definition file |
Throws
InvalidInputException When the frontmatter, the headings or the blocks break the profileJsonException When the profile's frontmatter schema cannot be convertedParseException When the bundled profile is malformedTest cases 4
Called from 1
Calls 19
- static-call Fields::mapping() line 41
- static-call
Yaml::parseFile()line 41 - static-call SchemaValidator::path() line 41
- static-call Fields::keys() line 42
- function-call
json_decodeline 45 - function-call
json_encodeline 45 - new InvalidInputException line 47
- method-call
Validator::validate()line 49 - new
Validatorline 49 - method-call
ErrorFormatter::format()line 51 - new
ErrorFormatterline 51 - static-call Fields::sequence() line 53
- function-call
countline 54 - method-call
Document::children()line 61 - static-call SectionBlocks::check() line 64
- static-call TextConstraint::matches() line 68
- static-call Nodes::text() line 68
- static-call AllowedBlocks::check() line 75
- static-call Occurrences::check() line 78
Test cases 10§
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 6
DefinitionReaderTestcallsDocumentReaderTestcallsLoaderTestcallsReferenceTestcallsMarkdownDocumentTestcallsFormatterTestcalls