Total Complexity | 6 |
Total Lines | 54 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
11 | class AnnotationCache implements AnnotationCacheInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var CacheInterface |
||
15 | */ |
||
16 | private $yiiCache; |
||
17 | |||
18 | /** |
||
19 | * AnnotationCache constructor. |
||
20 | * @param CacheInterface $yiiCache |
||
21 | */ |
||
22 | 17 | public function __construct(CacheInterface $yiiCache) |
|
23 | { |
||
24 | 17 | $this->yiiCache = $yiiCache; |
|
25 | 17 | } |
|
26 | |||
27 | /** |
||
28 | * {@inheritDoc} |
||
29 | */ |
||
30 | 10 | public function fetch($id) |
|
31 | { |
||
32 | 10 | return $this->yiiCache->get($id); |
|
33 | } |
||
34 | |||
35 | /** |
||
36 | * {@inheritDoc} |
||
37 | */ |
||
38 | 3 | public function contains($id): bool |
|
39 | { |
||
40 | 3 | return $this->yiiCache->exists($id); |
|
41 | } |
||
42 | |||
43 | /** |
||
44 | * {@inheritDoc} |
||
45 | */ |
||
46 | 9 | public function save($id, $data, $lifeTime = 0): bool |
|
47 | { |
||
48 | 9 | return $this->yiiCache->set($id, $data, $lifeTime); |
|
49 | } |
||
50 | |||
51 | /** |
||
52 | * {@inheritDoc} |
||
53 | */ |
||
54 | 1 | public function delete($id): bool |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * {@inheritDoc} |
||
61 | */ |
||
62 | 1 | public function getStats(): ?array |
|
65 | } |
||
66 | } |
||
67 |