classValueChoices
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
$choice | Closure(positive-int): ?int | Null selects representatives after decision input ends |
public function value(int $index, string $definition, ?ValueDomain $domain): ?stringSamples once per occurrence and domain; null retains the declared representatives.
Parameters
$index | int | |
$definition | string | |
$domain | ?ValueDomain |
Returns
?stringTest cases 1
ValueChoicesTest::testValueSamplesOncePerOccurrenceAndDefinitioncovers and calls
Calls 2
- function-call
array_key_existsline 37 - method-call ValueChoices::index() line 38
public function index(positive-int $count): intParameters
$count | positive-int |
Returns
intThrows
InvalidArgumentException When a caller supplies an out-of-range decisionTest cases 2
Called from 1
Calls 1
- new
InvalidArgumentExceptionline 51
Private surface 2§
Implementation details, listed for orientation only.
private array<string, string|null> $values = []private Closure(positive-int): ?int $choiceTest 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
IntegerLexemeGeneratorTest::testGenerateBoundsExplorationOfAnUnboundedScannerFamilyWithoutEnumeratingItsValuescallsBytePlanCompilerTestcallsPlanBuilderTestcallsGrammarCoverageTestcallsDerivationTraceTestcallsTokenGeneratorTestcallsLexicalExceptionTestcallsLexemeSequenceTestcallsBoundaryCompletionTestcallsCandidateResolverTestcallsReverseLexemeGeneratorTestcallsSqlGeneratorTestcallsTerminalSequenceTestcallsCharacterDomainTestcallsChoiceDomainTestcallsIntegerDomainTestcallsSequenceDomainTestcallsValueDomainTestcallsGenerationContextTestcallsCharsetLexemeGeneratorTestcallsCharsetValueLexemeGeneratorTest::testGenerateSamplesCharsetCompatibleBytesWithoutRestrictingOrdinaryBinaryValuescallsDefinitionFactoryTest::testBinaryAndStringsConstructCompleteAsciiValuesAfterIntroducersValuecallsDefinitionFactoryTest::testCreateConstructsCompleteDollarDelimitersAndUnescapedBodiesDollarStringcallsDefinitionFactoryTest::testCreateConstructsScannerBoundaryValuesValuecallsDefinitionFactoryTest::testStringsKeepsConstructedIntroducedValuesValidUnderAnExplicitAsciiCharsetValuecallsLexicalGrammarTestcallsMySqlProviderTestcallsGenerationContextTestcallsDefinitionFactoryTest::testCreateConstructsScannerBoundaryValuesValuecallsLexicalGrammarTestcallsPostgreSqlProviderTestcallsSqlGeneratorFactoryTestcallsGenerationContextTestcallsDefinitionFactoryTest::testCreateConstructsScannerBoundaryValuesValuecallsLexicalGrammarTestcallsSqliteProviderTestcalls