classRadixDomain
final class RadixDomain
implements ValueDomain
Prefixed and quoted radix literals. Whole-byte sampling is a charset constraint; the same lexical declaration reads ordinary and explicitly requested bytes.
Methods§
public function __construct(
private non-empty-string $digits,
private non-empty-string $prefix,
private non-empty-list<string> $quotedPrefixes,
private int $quotedMultiple,
private int $maximum,
private bool $ascii = false,
)Parameters
$digits | non-empty-string | |
$prefix | non-empty-string | |
$quotedPrefixes | non-empty-list<string> | |
$quotedMultiple | int | |
$maximum | int | |
$ascii | bool |
public function choose(Closure(positive-int): int $choose): stringConstructs whole ASCII bytes for an introducer and arbitrary radix digits otherwise.
Parameters
$choose | Closure(positive-int): int |
Returns
stringTest cases 1
RadixDomainTest::testChooseConstructsEvenHexAndWholeAsciiBytescovers and calls
Calls 8
- function-call
strlenline 43 - function-call
array_mapline 45 - function-call
sprintfline 45 - function-call
rangeline 45 - function-call
str_splitline 46 - function-call
intdivline 48 - method-call CharacterDomain::choose() line 50
- new CharacterDomain line 50
public function match(string $value, int $offset = 0): list<int>Reads complete prefixed runs or a quoted run closed by its first delimiter.
Parameters
$value | string | |
$offset | int |
Returns
list<int>Test cases 2
Called from 1
Calls 8
- function-call
substrline 60 - function-call
strlenline 60 - method-call CharacterDomain::match() line 61
- new CharacterDomain line 61
- function-call
str_splitline 61 - method-call SequenceDomain::match() line 63
- new SequenceDomain line 63
- new WordDomain line 63
public function digits(string $value): ?stringReturns the encoded magnitude only after the complete spelling matches this declaration.
Parameters
$value | string |
Returns
?stringTest cases 1
RadixDomainTest::testDigitsDecodesOnlyCompleteMatchingFormscovers and calls
Called from 3
- method-call SqlFaker\MySql\Generation\Lexeme\BoundedIntegerLexemeGenerator::accepts() packages/sql-faker/src/MySql/Generation/Lexeme/BoundedIntegerLexemeGenerator.php:70
- method-call SqlFaker\MySql\Generation\Lexeme\CharsetLexemeGenerator::bytes() packages/sql-faker/src/MySql/Generation/Lexeme/CharsetLexemeGenerator.php:49
- method-call SqlFaker\MySql\Generation\Lexeme\CharsetLexemeGenerator::bytes() packages/sql-faker/src/MySql/Generation/Lexeme/CharsetLexemeGenerator.php:53
Private surface 6§
Implementation details, listed for orientation only.
private non-empty-string $digitsprivate non-empty-string $prefixprivate non-empty-list<string> $quotedPrefixesprivate int $quotedMultipleprivate int $maximumprivate bool $ascii = falseTest cases 14§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
RadixDomainTest::testChooseConstructsEvenHexAndWholeAsciiBytescovers and callsRadixDomainTest::testDigitsDecodesOnlyCompleteMatchingFormscovers and callsRadixDomainTest::testMatchKeepsLexicalFormsIndependentOfSamplingBudgetscovers and calls
Other tests reaching this symbol 11
LexicalExceptionTestcallsGenerationContextTestcallsBoundedIntegerLexemeGeneratorTestcallsCharsetLexemeGeneratorTestcallsCharsetValueLexemeGeneratorTestcallsDefinitionFactoryTestcallsLexicalGrammarTestcallsMySqlProviderTestcallsPostgreSqlProviderTestcallsSqlGeneratorFactoryTestcallsSqliteProviderTestcalls
Relations§
Instantiated in 7
- new SqlFaker\MySql\Generation\Lexeme\BoundedIntegerLexemeGenerator::accepts() packages/sql-faker/src/MySql/Generation/Lexeme/BoundedIntegerLexemeGenerator.php:70
- new SqlFaker\MySql\Generation\Lexeme\CharsetLexemeGenerator::bytes() packages/sql-faker/src/MySql/Generation/Lexeme/CharsetLexemeGenerator.php:49
- new SqlFaker\MySql\Generation\Lexeme\CharsetLexemeGenerator::bytes() packages/sql-faker/src/MySql/Generation/Lexeme/CharsetLexemeGenerator.php:53
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1548
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1562
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1578
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1592
Method calls 3
- method-call SqlFaker\MySql\Generation\Lexeme\BoundedIntegerLexemeGenerator::accepts() packages/sql-faker/src/MySql/Generation/Lexeme/BoundedIntegerLexemeGenerator.php:70
- method-call SqlFaker\MySql\Generation\Lexeme\CharsetLexemeGenerator::bytes() packages/sql-faker/src/MySql/Generation/Lexeme/CharsetLexemeGenerator.php:49
- method-call SqlFaker\MySql\Generation\Lexeme\CharsetLexemeGenerator::bytes() packages/sql-faker/src/MySql/Generation/Lexeme/CharsetLexemeGenerator.php:53