Total Complexity | 2 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | final class Random |
||
19 | { |
||
20 | /** |
||
21 | * Generates a random string of specified length. |
||
22 | * The string generated matches [A-Za-z0-9_-]+ and is transparent to URL-encoding. |
||
23 | * |
||
24 | * @param int $length The length of the key in characters. |
||
25 | * |
||
26 | * @throws \Exception On failure. |
||
27 | * |
||
28 | * @return string The generated random key. |
||
29 | */ |
||
30 | 5 | public static function string(int $length = 32): string |
|
42 |