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