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 domainTest cases 23
BoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#0coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#1coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#10coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#11coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#12coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#13coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#14coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#15coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#16coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#17coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#18coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#2coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#3coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#4coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#5coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#6coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#7coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#8coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#9coversBoundedIntegerLexemeGeneratorTest::testAcceptsUsesBothConfiguredBoundsForDecimalAndHexadecimalValuescoversBoundedIntegerLexemeGeneratorTest::testGenerateKeepsTheExplicitHexSpellingAndOrigincoversBoundedIntegerLexemeGeneratorTest::testGenerateProvidesBoundaryRepresentativesWithoutClaimingOtherNumberscoversBoundedIntegerLexemeGeneratorTest::testGenerateSupportsASingletonDomainAndContinuesPastInvalidDefaultscovers
Calls 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::testGenerateKeepsTheExplicitHexSpellingAndOrigincovers and callsBoundedIntegerLexemeGeneratorTest::testGenerateProvidesBoundaryRepresentativesWithoutClaimingOtherNumberscovers and callsBoundedIntegerLexemeGeneratorTest::testGenerateSupportsASingletonDomainAndContinuesPastInvalidDefaultscovers and calls
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 24
BoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceIntervalcallsBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#0coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#1coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#10coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#11coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#12coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#13coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#14coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#15coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#16coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#17coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#18coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#2coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#3coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#4coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#5coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#6coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#7coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#8coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#9coversBoundedIntegerLexemeGeneratorTest::testAcceptsUsesBothConfiguredBoundsForDecimalAndHexadecimalValuescovers and callsBoundedIntegerLexemeGeneratorTest::testGenerateKeepsTheExplicitHexSpellingAndOrigincoversBoundedIntegerLexemeGeneratorTest::testGenerateProvidesBoundaryRepresentativesWithoutClaimingOtherNumberscoversBoundedIntegerLexemeGeneratorTest::testGenerateSupportsASingletonDomainAndContinuesPastInvalidDefaultscovers
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 33§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 24
BoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceIntervalcallsBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#0coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#1coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#10coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#11coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#12coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#13coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#14coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#15coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#16coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#17coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#18coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#2coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#3coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#4coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#5coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#6coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#7coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#8coversBoundedIntegerLexemeGeneratorTest::testAcceptsUnsignedFormsWithinTheSourceInterval#9coversBoundedIntegerLexemeGeneratorTest::testAcceptsUsesBothConfiguredBoundsForDecimalAndHexadecimalValuescovers and callsBoundedIntegerLexemeGeneratorTest::testGenerateKeepsTheExplicitHexSpellingAndOrigincovers and callsBoundedIntegerLexemeGeneratorTest::testGenerateProvidesBoundaryRepresentativesWithoutClaimingOtherNumberscovers and callsBoundedIntegerLexemeGeneratorTest::testGenerateSupportsASingletonDomainAndContinuesPastInvalidDefaultscovers and calls
Other tests reaching this symbol 9
LexicalExceptionTestcallsGenerationContextTestcallsCharsetValueLexemeGeneratorTestcallsDefinitionFactoryTestcallsLexicalGrammarTestcallsMySqlProviderTestcallsPostgreSqlProviderTestcallsSqlGeneratorFactoryTestcallsSqliteProviderTestcalls
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