classBoundedIntegerLexemeGenerator
final class BoundedIntegerLexemeGenerator
implements LexemeGenerator
Restricts MySQL decimal and hexadecimal forms to a source-defined nonnegative 31-bit interval.
Methods§
public function __construct(
private string $terminal,
private int $minimum,
private int $maximum,
private non-empty-list<string> $defaults,
private string $definition,
)Parameters
$terminal | string | |
$minimum | int | |
$maximum | int | |
$defaults | non-empty-list<string> | |
$definition | string |
Throws
InvalidArgumentException When the declared interval exceeds the portable 31-bit domainCalls 1
- new
InvalidArgumentExceptionline 36
public function generate(LexemeInput $input): ?LexemeCandidatesRetains the grammar's decimal and hexadecimal integer forms within the configured bounds.
Parameters
$input | LexemeInput |
Returns
Test cases 3
BoundedIntegerLexemeGeneratorTest::testGenerateKeepsTheExplicitHexSpellingAndOrigincallsBoundedIntegerLexemeGeneratorTest::testGenerateProvidesBoundaryRepresentativesWithoutClaimingOtherNumberscallsBoundedIntegerLexemeGeneratorTest::testGenerateSupportsASingletonDomainAndContinuesPastInvalidDefaultscalls
Calls 6
- method-call LexemeInput::terminal() line 46
- new IntegerDomain line 49
- method-call BoundedIntegerLexemeGenerator::accepts() line 52
- new LexemeSequence line 55
- new Lexeme line 56
- static-call LexemeCandidates::of() line 59
public function accepts(string $spelling): boolRejects oversized hex magnitudes before conversion, including on 32-bit PHP.
Parameters
$spelling | string |
Returns
boolTest cases 2
Called from 1
Calls 7
- method-call IntegerLexemeGenerator::accepts() line 67
- new IntegerLexemeGenerator line 67
- method-call RadixDomain::digits() line 70
- new RadixDomain line 70
- function-call
ltrimline 74 - function-call
strlenline 75 - function-call
hexdecline 78
Private surface 5§
Implementation details, listed for orientation only.
private string $terminalprivate int $minimumprivate int $maximumprivate non-empty-list<string> $defaultsprivate string $definitionTest cases 14§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
BoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceIntervalcallsBoundedIntegerLexemeGeneratorTest::testAcceptsUsesBothConfiguredBoundsForDecimalAndHexadecimalValuescallsBoundedIntegerLexemeGeneratorTest::testGenerateKeepsTheExplicitHexSpellingAndOrigincallsBoundedIntegerLexemeGeneratorTest::testGenerateProvidesBoundaryRepresentativesWithoutClaimingOtherNumberscallsBoundedIntegerLexemeGeneratorTest::testGenerateSupportsASingletonDomainAndContinuesPastInvalidDefaultscalls
Other tests reaching this symbol 9
LexicalExceptionTestcallsGenerationContextTestcallsCharsetValueLexemeGeneratorTestcallsDefinitionFactoryTestcallsLexicalGrammarTestcallsSqlGeneratorFactoryTestcallsMySqlProviderTestcallsPostgreSqlProviderTestcallsSqliteProviderTestcalls
Relations§
Instantiated in 8
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1150
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1192
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1199
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1221
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1277
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1305
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1312
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1319