final class DefinitionReader

Reads the definition files that the configuration's patterns match.

Files are read in path order; item and source IDs must be unique across them, and Markdown links to other items must point to the files that define them.

Methods§

public function read(
    string $directory,
    list<string> $patterns,
    array<string, mixed> $markdown,
): Definitions

Reads every matched definition file.

Parameters

$directorystringThe configuration directory the patterns resolve against
$patternslist<string>Glob patterns of definition files
$markdownarray<string, mixed>The markdown options

Returns

Definitions The items, sources and files

Throws

InvalidInputException When a pattern matches nothing, a definition is invalid or an ID repeats
JsonException When a document cannot be converted
ParseException When a YAML definition is malformed
Test cases 18
Called from 1
Calls 15

Test cases 31§

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

Dedicated tests 18
Other tests reaching this symbol 13

Relations§

Instantiated in 1
Method calls 1