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