final class ValueChoices

Per-plan decisions, memoized so repeated candidate inspection cannot consume more randomness. The caller interprets bytes; domains only receive bounded index decisions.

Methods§

public function __construct(private Closure(positive-int): ?int $choice)

Parameters

$choiceClosure(positive-int): ?intNull selects representatives after decision input ends
Test cases 2
public function value(int $index, string $definition, ?ValueDomain $domain): ?string

Samples once per occurrence and domain; null retains the declared representatives.

Parameters

$indexint
$definitionstring
$domain?ValueDomain

Returns

?string
Test cases 1
Calls 2
public function index(positive-int $count): int

Parameters

$countpositive-int

Returns

int

Throws

InvalidArgumentException When a caller supplies an out-of-range decision
Test cases 2
Called from 1
Calls 1
  • new InvalidArgumentException line 51

Private surface 2§

Implementation details, listed for orientation only.

private array<string, string|null> $values = []
private Closure(positive-int): ?int $choice

Test cases 38§

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 36

Relations§

Instantiated in 1
Type declarations 2