final class TextSource
    implements SourceExtension

Selects nonblank lines of a plain-text source with lines:START-END or lines:NUMBER.

Methods§

public function __construct(private ResourceLoader $loader = new \Requirements\Source\ResourceLoader())

Parameters

$loaderResourceLoaderReads the source document
Calls 1
public function select(
    Source $source,
    string $selector,
    string $directory,
    bool $live,
): list<Unit>

Selects the nonblank lines of a line range.

Parameters

$sourceSourceThe source declaration
$selectorstringThe line range
$directorystringThe configuration directory
$liveboolWhether to read the current URI instead of a pinned snapshot

Returns

list<Unit> One unit per nonblank line, located as line:N

Throws

RuntimeException When the selector is malformed, the range lies outside the source or the source cannot be read
Test cases 6
Calls 7

Private surface 1§

Implementation details, listed for orientation only.

private ResourceLoader $loader = new \Requirements\Source\ResourceLoader()

Test cases 19§

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

Dedicated tests 5
Other tests reaching this symbol 14

Relations§

Instantiated in 1