final class ConstraintDependencies

Finds exactly which grammar rules can reach a still-constrained occurrence.

Methods§

public function __construct(Grammar $grammar)

Builds reverse grammar edges once, including recursive components.

Parameters

$grammarGrammar
Test cases 1
public function affected(
    GenerationPlan<bool> $plan,
    array<string, int> $occurrences,
): array<string, true>

Caches by the remaining constraint targets, independently of their exact pattern or counter values.

Parameters

$planGenerationPlan<bool>
$occurrencesarray<string, int>

Returns

array<string, true>
Test cases 1
Called from 1
Calls 5

Private surface 2§

Implementation details, listed for orientation only.

private array<string, array<string, true>> $parents = []
private array<string, array<string, true>> $cache = []

Test cases 20§

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 19

Relations§

Instantiated in 1
Method calls 1
Type declarations 1