interface SourceExtension
Public API: explicitly declared with @visibility public.

Reads a source format and selects the units that coverage counts and evidence quotes.

A unit has a stable location and its complete normalized text. The same method selects the coverage scope, with the source's own selector, and the unit an evidence entry names, with that entry's selector.

Selecting every line of an in-memory notedoctest
$notes = new class () implements \Requirements\Source\SourceExtension { public function select(\Requirements\Model\Source $source, string $selector, string $directory, bool $live): array { return [new \Requirements\Source\Unit('note:1', 'Names start with a letter.')]; } };
    $notes->select(new \Requirements\Model\Source('notes', 'memory:notes', 'notes', '*'), '*', '/', false)[0]->text // => 'Names start with a letter.'

Methods§

public function select(
    Source $source,
    string $selector,
    string $directory,
    bool $live,
): list<Unit>

Selects source units.

Parameters

$sourceSourceThe source declaration
$selectorstringThe scope selector or an evidence selector
$directorystringThe configuration directory that relative paths resolve against
$liveboolWhether to read the current URI instead of a pinned snapshot

Returns

list<Unit> The selected units

Test cases 3§

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

Dedicated tests 1
Other tests reaching this symbol 2

Relations§

Implemented by 5
Constant reads 1
Type declarations 1