Total Complexity | 6 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | class SessionTokenStorage implements TokenStorageInterface { |
||
7 | |||
8 | protected $key = '_CSRF'; |
||
9 | |||
10 | protected function getKey($id) { |
||
11 | return $this->key . '/' . $id; |
||
12 | } |
||
13 | |||
14 | public function __construct(string $key = '_CSRF') { |
||
15 | $this->key = $key; |
||
16 | } |
||
17 | |||
18 | public function set(string $id, string $token): void { |
||
19 | USession::set($this->getKey($id), $token); |
||
20 | } |
||
21 | |||
22 | public function get(string $id): ?string { |
||
24 | } |
||
25 | |||
26 | public function exists(string $id): bool { |
||
27 | return USession::exists($this->getKey($id)); |
||
28 | } |
||
29 | |||
30 | public function remove(string $id): ?string { |
||
34 | } |
||
35 | } |
||
36 | |||
37 |