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 |
Test cases 18
IntegerLexemeGeneratorTest::testAcceptsSupportsTheScannerOverflowFamilyWithNoArtificialExplicitUpperBoundcoversIntegerLexemeGeneratorTest::testAcceptsTreatsZeroAsOneSignificantDigitcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#above maximumcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#below minimumcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#emptycoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#exponentcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#fractioncoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#leading zeroescoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#longer magnitudecoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#maximumcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#minimumcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#negativecoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#shorter magnitudecoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#signed spellingcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#whitespacecoversIntegerLexemeGeneratorTest::testGenerateBoundsExplorationOfAnUnboundedScannerFamilyWithoutEnumeratingItsValuescoversIntegerLexemeGeneratorTest::testGeneratePreservesExplicitLeadingZeroesAndTheirSourceOccurrencecoversIntegerLexemeGeneratorTest::testGenerateSeparatesAnInvalidValueFromNonApplicabilitycovers
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::testGenerateBoundsExplorationOfAnUnboundedScannerFamilyWithoutEnumeratingItsValuescovers and callsIntegerLexemeGeneratorTest::testGeneratePreservesExplicitLeadingZeroesAndTheirSourceOccurrencecovers and callsIntegerLexemeGeneratorTest::testGenerateSeparatesAnInvalidValueFromNonApplicabilitycovers and calls
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 19
IntegerLexemeGeneratorTest::testAcceptsSupportsTheScannerOverflowFamilyWithNoArtificialExplicitUpperBoundcovers and callsIntegerLexemeGeneratorTest::testAcceptsTreatsZeroAsOneSignificantDigitcovers and callsIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCastcallsIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#above maximumcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#below minimumcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#emptycoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#exponentcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#fractioncoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#leading zeroescoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#longer magnitudecoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#maximumcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#minimumcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#negativecoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#shorter magnitudecoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#signed spellingcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#whitespacecoversIntegerLexemeGeneratorTest::testGenerateBoundsExplorationOfAnUnboundedScannerFamilyWithoutEnumeratingItsValuescovers and callsIntegerLexemeGeneratorTest::testGeneratePreservesExplicitLeadingZeroesAndTheirSourceOccurrencecoversIntegerLexemeGeneratorTest::testGenerateSeparatesAnInvalidValueFromNonApplicabilitycovers
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 35§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 19
IntegerLexemeGeneratorTest::testAcceptsSupportsTheScannerOverflowFamilyWithNoArtificialExplicitUpperBoundcovers and callsIntegerLexemeGeneratorTest::testAcceptsTreatsZeroAsOneSignificantDigitcovers and callsIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCastcallsIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#above maximumcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#below minimumcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#emptycoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#exponentcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#fractioncoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#leading zeroescoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#longer magnitudecoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#maximumcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#minimumcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#negativecoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#shorter magnitudecoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#signed spellingcoversIntegerLexemeGeneratorTest::testAcceptsUsesTheExactUnsignedMagnitudeInsteadOfAPhpIntegerCast#whitespacecoversIntegerLexemeGeneratorTest::testGenerateBoundsExplorationOfAnUnboundedScannerFamilyWithoutEnumeratingItsValuescovers and callsIntegerLexemeGeneratorTest::testGeneratePreservesExplicitLeadingZeroesAndTheirSourceOccurrencecovers and callsIntegerLexemeGeneratorTest::testGenerateSeparatesAnInvalidValueFromNonApplicabilitycovers and calls
Other tests reaching this symbol 16
LexicalExceptionTestcallsGenerationContextTestcallsBoundedIntegerLexemeGeneratorTestcallsCharsetLexemeGeneratorTestcallsCharsetValueLexemeGeneratorTestcallsDefinitionFactoryTestcallsPrecisionLexemeGeneratorTestcallsSizeNumberLexemeGeneratorTestcallsLexicalGrammarTestcallsMySqlProviderTestcallsGenerationContextTestcallsDefinitionFactoryTestcallsLexicalGrammarTestcallsPostgreSqlProviderTestcallsSqlGeneratorFactoryTestcallsSqliteProviderTestcalls
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:744
- new SqlFaker\PostgreSql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/PostgreSql/Generation/Lexeme/DefinitionFactory.php:752
- new SqlFaker\PostgreSql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/PostgreSql/Generation/Lexeme/DefinitionFactory.php:760
- new SqlFaker\PostgreSql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/PostgreSql/Generation/Lexeme/DefinitionFactory.php:768
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