Total Complexity | 7 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 6 | ||
Bugs | 1 | Features | 3 |
1 | <?php |
||
6 | class NonceGenerator { |
||
7 | |||
8 | private array $nonces = []; |
||
9 | |||
10 | private $onNonce; |
||
11 | |||
12 | public function __construct(?callable $onNonce) { |
||
14 | } |
||
15 | |||
16 | protected function _generateNonce(string $name, ?int $value = null): string { |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * Returns a new or an existing nonce value. |
||
28 | * |
||
29 | * @param string $name |
||
30 | * @param int $size |
||
31 | * @return string |
||
32 | */ |
||
33 | public function getNonce(string $name, int $size = 32): string { |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * |
||
39 | * @param string $name |
||
40 | * @return bool |
||
41 | */ |
||
42 | public function hasNonce(string $name): bool { |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * |
||
48 | * @return string |
||
49 | */ |
||
50 | public function __toString() { |
||
54 |