final class LiteralGenerator
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

Generates MySql literal bodies for the bounded lexical API.

Owns the alphabets and numeric formatting used by this dialect.

Methods§

public function __construct(Generator $faker)

Parameters

$fakerGeneratorSource of every choice the generated strings make
Test cases 433
Calls 1
public function mixedAlnumString(int $minLength = 1, int $maxLength = 24): string

Generate a random string from the mixed alphanumeric+underscore alphabet.

Parameters

$minLengthint
$maxLengthint

Returns

string
Test cases 21
Called from 2
Calls 3
public function hexString(int $minLength = 1, int $maxLength = 16): string
public function decimalString(int $precision = 13, int $scale = 6): non-empty-string

Generate a random decimal literal string.

Parameters

$precisionint
$scaleint

Returns

non-empty-string
Test cases 18
Called from 1
Calls 4
public function hostnameString(
    int $minParts = 1,
    int $maxParts = 3,
    int $minPartLength = 1,
    int $maxPartLength = 12,
): non-empty-string
public function floatString(
    string $mantissa,
    int $minExponent = -20,
    int $maxExponent = 20,
): non-empty-string

Private surface 9§

Implementation details, listed for orientation only.

private const ALPHA_UNDERSCORE = 'abcdefghijklmnopqrstuvwxyz_'
private const ALNUM_UNDERSCORE = 'abcdefghijklmnopqrstuvwxyz0123456789_'
private const MIXED_ALNUM_UNDERSCORE = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'
private const HOSTNAME_CHARS = 'abcdefghijklmnopqrstuvwxyz0123456789'
private const HEX_CHARS = '0123456789abcdef'
private const DIGIT_CHARS = '0123456789'
private const BINARY_CHARS = '01'
private Generator $faker
private RandomCharacters $characters

Test cases 436§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 38
Other tests reaching this symbol 398

Relations§

Instantiated in 1
Method calls 12
Type declarations 1