final class Loader

Loads a project from its requirements.yaml and the definition files it names.

Every document is validated against its schema, every item against the definition rules, links between items and to runners are resolved, and each source format and runner extension must be registered.

Methods§

public function load(string $file): Project

Loads and validates a project.

Parameters

$filestringThe configuration file

Returns

Project The project

Throws

InvalidInputException When the configuration, a definition or a link is invalid
JsonException When a document cannot be converted
ParseException When a YAML document is malformed
Test cases 70
Called from 1
Calls 24
public function document(
    string $path,
    string $kind = 'definition',
    array<string, mixed> $markdown = [],
): array<string, mixed>

Reads and validates one document as a mapping.

Parameters

$pathstringThe document file
$kindstring"config" or "definition", naming the schema
$markdownarray<string, mixed>The markdown options

Returns

array<string, mixed> The document

Throws

InvalidInputException When the document breaks its schema or is not a mapping
JsonException When the document cannot be converted
ParseException When a YAML document is malformed
Test cases 15
Called from 1
Calls 3

Test cases 78§

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

Dedicated tests 31
Other tests reaching this symbol 47

Relations§

Instantiated in 1
Method calls 1