Total Complexity | 4 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
9 | class RedisCacheProvider implements CacheProvider{ |
||
10 | /** @var Redis */ |
||
11 | private $redis = null; |
||
12 | |||
13 | 2 | public function __construct($redis = null){ |
|
14 | 2 | $this->redis = $redis; |
|
15 | 2 | } |
|
16 | |||
17 | 1 | public function set($key,$jsonobj,$expireAt){ |
|
18 | 1 | $data = $jsonobj; |
|
19 | 1 | $data->expires_at = $expireAt; |
|
20 | 1 | $this->redis->set($key, json_encode($data)); |
|
21 | 1 | } |
|
22 | |||
23 | 2 | public function get($key){ |
|
24 | 2 | return $this->redis->get($key); |
|
25 | } |
||
26 | |||
27 | 1 | public function clear($key){ |
|
29 | } |
||
30 | } |