final class Unit
Public API: explicitly declared with @visibility public.

A complete unit of source text at a stable location, such as a paragraph or a line.

Normalizing whitespace the way quotations are compareddoctest
\Requirements\Source\Unit::normalize("  Names\n\tstart  with a letter. ") // => 'Names start with a letter.'
Identifying a unit within its sourcedoctest
$unit = new \Requirements\Source\Unit('line:1', 'Names start with a letter.');
    strlen($unit->key(new \Requirements\Model\Source('notes', 'notes.txt', 'text', 'lines:1'))) // => 64

Properties§

public string $location
public string $text

Methods§

public function __construct(public string $location, public string $text)

Parameters

$locationstringThe stable location of the unit within its source
$textstringThe complete normalized text of the unit

Test cases 72§

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 68

Relations§

Instantiated in 3
Static calls 9
Type declarations 2