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
Calls 1
public function rawIdentifier(int $minLength = 1, int $maxLength = 12): string
public function integerString(int $min = 1, int $max = 9999999999): non-empty-string
public function binaryString(int $minLength = 1, int $maxLength = 32): string
public function hostnameString(
    int $minParts = 1,
    int $maxParts = 3,
    int $minPartLength = 1,
    int $maxPartLength = 12,
): non-empty-string

Generate a random hostname string.

Parameters

$minPartsint
$maxPartsint
$minPartLengthint
$maxPartLengthint

Returns

non-empty-string

Throws

LogicException When the requested bounds leave every part of the hostname empty
Test cases 3
Called from 1
Calls 5
public function unsignedBigIntString(int $minLength = 1, int $maxLength = 20): non-empty-string
public function longIntString(int $min = 0, int $max = 2147483647): non-empty-string

Generate a random long integer string.

Parameters

$minint
$maxint

Returns

non-empty-string
Test cases 2
Called from 1
Calls 1
  • method-call Generator::numberBetween() line 146
public function floatString(
    string $mantissa,
    int $minExponent = -20,
    int $maxExponent = 20,
): non-empty-string

Generate a random float literal string with exponent.

Parameters

$mantissastring
$minExponentint
$maxExponentint

Returns

non-empty-string
Test cases 2
Called from 1
Calls 1
  • method-call Generator::numberBetween() line 158

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 43§

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 5

Relations§

Instantiated in 1
Method calls 12
Type declarations 1