Total Complexity | 6 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
22 | class Cache extends AbstractAdapter implements \SessionHandlerInterface |
||
23 | { |
||
24 | /** |
||
25 | * Check and setup Redis server |
||
26 | * |
||
27 | * @param array $settings |
||
28 | * |
||
29 | * @throws ConfigurationException |
||
30 | */ |
||
31 | public function __construct(array $settings = []) |
||
36 | ); |
||
37 | } |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Read session data |
||
42 | * |
||
43 | * @param string $id |
||
44 | * |
||
45 | * @return string |
||
46 | * @throws \Psr\Cache\InvalidArgumentException |
||
47 | */ |
||
48 | public function read($id): string |
||
49 | { |
||
50 | return Proxy\Cache::get($this->prepareId($id)) ?: ''; |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * Write session data |
||
55 | * |
||
56 | * @param string $id |
||
57 | * @param string $data |
||
58 | * |
||
59 | * @return bool |
||
60 | * @throws \Psr\Cache\InvalidArgumentException |
||
61 | */ |
||
62 | public function write($id, $data): bool |
||
63 | { |
||
64 | return Proxy\Cache::set($this->prepareId($id), $data, $this->ttl); |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * Destroy a session |
||
69 | * |
||
70 | * @param integer $id |
||
71 | * |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function destroy($id): bool |
||
77 | } |
||
78 | } |
||
79 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.