final class SpacingConstraint

Allowed boundary spellings with every contributing rule retained for diagnostics.

Constants§

public const JOIN = 1

Allows adjacent lexemes with no separator.

public const SPACE = 2

Allows a single space between lexemes.

public const EITHER = 3

Allows either supported separator form.

Properties§

public int $allowed = self::EITHER
public list<string> $rules = []

Methods§

public function __construct(public int $allowed = self::EITHER, public list<string> $rules = [])
public function intersect(self $other): self

Keeps only separators allowed by both constraints and retains both sources.

Parameters

$otherself

Returns

self
Test cases 1
Calls 3
public function separator(): ?string

Selects the default single space when permitted, a join otherwise, or null on contradiction.

Returns

?string
Test cases 2
Calls 2

Test cases 71§

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

Dedicated tests 2
Other tests reaching this symbol 69

Relations§

Instantiated in 15
Constant reads 14
Type checks 1
Type declarations 12