classIntegerLexemeGenerator
final class IntegerLexemeGenerator
implements LexemeGenerator
An unsigned decimal scanner domain whose inclusive bounds do not depend on PHP's integer width.
Methods§
public function __construct(
private string $terminal,
private string $minimum,
private ?string $maximum,
private non-empty-list<string> $defaults,
private string $definition,
private bool $digitSeparators = false,
)Binds the source-defined magnitude interval and bounded default representatives. A null upper bound supports scanners that classify all larger integers into another token family.
Parameters
$terminal | string | |
$minimum | string | |
$maximum | ?string | |
$defaults | non-empty-list<string> | |
$definition | string | |
$digitSeparators | bool |
public function generate(LexemeInput $input): ?LexemeCandidatesPreserves valid explicit spellings, including leading zeroes, without narrowing through a PHP integer cast.
Parameters
$input | LexemeInput |
Returns
Test cases 3
IntegerLexemeGeneratorTest::testGenerateBoundsExplorationOfAnUnboundedScannerFamilyWithoutEnumeratingItsValuescallsIntegerLexemeGeneratorTest::testGeneratePreservesExplicitLeadingZeroesAndTheirSourceOccurrencecallsIntegerLexemeGeneratorTest::testGenerateSeparatesAnInvalidValueFromNonApplicabilitycalls
Called from 1
Calls 6
- method-call LexemeInput::terminal() line 41
- new IntegerDomain line 44
- method-call IntegerLexemeGenerator::accepts() line 47
- new LexemeSequence line 50
- new Lexeme line 51
- static-call LexemeCandidates::of() line 54
public function accepts(string $spelling): boolCompares decimal magnitudes by significant digit count, then lexicographically at equal length.
Parameters
$spelling | string |
Returns
boolTest cases 4
IntegerLexemeGeneratorTest::testAcceptsSupportsTheScannerOverflowFamilyWithNoArtificialExplicitUpperBoundcallsIntegerLexemeGeneratorTest::testAcceptsTreatsZeroAsOneSignificantDigitcallsIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCastcallsIntegerLexemeGeneratorTest::testGenerateBoundsExplorationOfAnUnboundedScannerFamilyWithoutEnumeratingItsValuescalls
Called from 2
- method-call SqlFaker\Generation\Candidate\IntegerLexemeGenerator::generate() packages/sql-faker/src/Generation/Candidate/IntegerLexemeGenerator.php:47
- method-call SqlFaker\MySql\Generation\Lexeme\BoundedIntegerLexemeGenerator::accepts() packages/sql-faker/src/MySql/Generation/Lexeme/BoundedIntegerLexemeGenerator.php:67
Calls 4
- new IntegerDomain line 62
- function-call
in_arrayline 63 - function-call
strlenline 63 - method-call IntegerDomain::match() line 63
Private surface 6§
Implementation details, listed for orientation only.
private string $terminalprivate string $minimumprivate ?string $maximumprivate non-empty-list<string> $defaultsprivate string $definitionprivate bool $digitSeparators = falseTest cases 24§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
IntegerLexemeGeneratorTest::testAcceptsSupportsTheScannerOverflowFamilyWithNoArtificialExplicitUpperBoundcallsIntegerLexemeGeneratorTest::testAcceptsTreatsZeroAsOneSignificantDigitcallsIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCastcallsIntegerLexemeGeneratorTest::testGenerateBoundsExplorationOfAnUnboundedScannerFamilyWithoutEnumeratingItsValuescallsIntegerLexemeGeneratorTest::testGeneratePreservesExplicitLeadingZeroesAndTheirSourceOccurrencecallsIntegerLexemeGeneratorTest::testGenerateSeparatesAnInvalidValueFromNonApplicabilitycalls
Other tests reaching this symbol 18
LexicalExceptionTestcallsGenerationContextTestcallsBoundedIntegerLexemeGeneratorTestcallsCharsetLexemeGeneratorTestcallsCharsetValueLexemeGeneratorTestcallsDefinitionFactoryTestcallsPrecisionLexemeGeneratorTestcallsSizeNumberLexemeGeneratorTestcallsLexicalGrammarTestcallsSqlGeneratorFactoryTestcallsMySqlProviderTestcallsGenerationContextTestcallsDefinitionFactoryTestcallsLexicalGrammarTestcallsSqlGeneratorFactoryTestcallsPostgreSqlProviderTestcallsSqlGeneratorFactoryTestcallsSqliteProviderTestcalls
Relations§
Instantiated in 21
- new SqlFaker\MySql\Generation\Lexeme\BoundedIntegerLexemeGenerator::accepts() packages/sql-faker/src/MySql/Generation/Lexeme/BoundedIntegerLexemeGenerator.php:67
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1185
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1228
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1235
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1242
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1249
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1256
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1263
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1270
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1284
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1291
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1298
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1439
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1446
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1453
- new SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:1460
- new SqlFaker\MySql\Generation\Lexeme\PrecisionLexemeGenerator::generate() packages/sql-faker/src/MySql/Generation/Lexeme/PrecisionLexemeGenerator.php:42
- new SqlFaker\PostgreSql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/PostgreSql/Generation/Lexeme/DefinitionFactory.php:745
- new SqlFaker\PostgreSql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/PostgreSql/Generation/Lexeme/DefinitionFactory.php:753
- new SqlFaker\PostgreSql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/PostgreSql/Generation/Lexeme/DefinitionFactory.php:761
- new SqlFaker\PostgreSql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/PostgreSql/Generation/Lexeme/DefinitionFactory.php:769
Method calls 2
- method-call SqlFaker\MySql\Generation\Lexeme\BoundedIntegerLexemeGenerator::accepts() packages/sql-faker/src/MySql/Generation/Lexeme/BoundedIntegerLexemeGenerator.php:67
- method-call SqlFaker\MySql\Generation\Lexeme\PrecisionLexemeGenerator::generate() packages/sql-faker/src/MySql/Generation/Lexeme/PrecisionLexemeGenerator.php:43