Total Complexity | 5 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
15 | class APCUCache extends CacheDriverAbstract{ |
||
16 | |||
17 | /** @inheritdoc */ |
||
18 | public function get($key, $default = null){ |
||
19 | $this->checkKey($key); |
||
20 | |||
21 | $value = apcu_fetch($key); |
||
22 | |||
23 | if($value !== false){ |
||
24 | return $value; |
||
25 | } |
||
26 | |||
27 | return $default; |
||
28 | } |
||
29 | |||
30 | /** @inheritdoc */ |
||
31 | public function set($key, $value, $ttl = null):bool{ |
||
32 | $this->checkKey($key); |
||
33 | |||
34 | return (bool)apcu_store($key, $value, $this->getTTL($ttl)); |
||
35 | } |
||
36 | |||
37 | /** @inheritdoc */ |
||
38 | public function delete($key):bool{ |
||
39 | $this->checkKey($key); |
||
40 | |||
41 | return (bool)apcu_delete($key); |
||
42 | } |
||
43 | |||
44 | /** @inheritdoc */ |
||
45 | public function clear():bool{ |
||
47 | } |
||
48 | |||
49 | } |
||
50 |