final class RandomCharacters

Draws a fixed number of bytes from a caller-supplied alphabet using Faker. Contains no identifier, literal, quoting or database rules.

Methods§

public function __construct(private Generator $faker)

Parameters

$fakerGeneratorSource of every choice a draw makes
public function string(string $alphabet, int $length): string

Draws a string of a given length from an alphabet.

Parameters

$alphabetstringCharacters that may appear
$lengthintHow many characters to draw

Returns

string String of that length, empty when no characters were asked for
Test cases 4
Called from 12
Calls 1

Private surface 1§

Implementation details, listed for orientation only.

private Generator $faker

Test cases 21§

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

Dedicated tests 5
Other tests reaching this symbol 16

Relations§

Instantiated in 3
Method calls 15
Type declarations 3