1 | <?php |
||
5 | class Token |
||
6 | { |
||
7 | /** |
||
8 | * @var array |
||
9 | */ |
||
10 | private static $characters = [ |
||
11 | 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'o', 'j', 'k', 'l', |
||
12 | 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', |
||
13 | 'E', 'F', 'G', 'H', 'O', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', |
||
14 | 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' |
||
15 | ]; |
||
16 | |||
17 | /** |
||
18 | * Generate a random string |
||
19 | * |
||
20 | * @param int $length |
||
21 | * @param mixed $type |
||
22 | * @param bool $caseSensitive |
||
23 | * @return string |
||
24 | */ |
||
25 | public static function generate($length = 128, $type = 'alnum', $caseSensitive = true) |
||
48 | |||
49 | /** |
||
50 | * Make the random string |
||
51 | * |
||
52 | * @param string $characters |
||
53 | * @param int $length |
||
54 | * @return string |
||
55 | */ |
||
56 | private static function make($characters, $length) |
||
66 | } |
||
67 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: