Total Complexity | 4 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
11 | class RandomStrings |
||
12 | { |
||
13 | /** @var string[] */ |
||
14 | public static array $possibilities = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']; |
||
15 | |||
16 | 8 | public static function generate(int $length = 64): string |
|
17 | { |
||
18 | 8 | return static::generateRandomText($length, static::$possibilities); |
|
19 | } |
||
20 | |||
21 | /** |
||
22 | * @param int $length |
||
23 | * @param string[] $possibilities |
||
24 | * @return string |
||
25 | */ |
||
26 | 9 | public static function generateRandomText(int $length, array $possibilities): string |
|
34 | } |
||
35 | |||
36 | 16 | public static function randomLength(): string |
|
42 |