Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | protected function randomString(int $length = 6): string |
||
34 | { |
||
35 | $str = ''; |
||
36 | $characters = array_merge(range('A','Z'), range('a','z'), range('0','9')); |
||
37 | $max = count($characters) - 1; |
||
38 | for ($i = 0; $i < $length; $i++) { |
||
39 | $rand = mt_rand(0, $max); |
||
40 | $str .= $characters[$rand]; |
||
41 | } |
||
42 | return $str; |
||
43 | } |
||
44 | } |
||
45 |