Completed
Branch ci (3ae4b3)
by Дмитрий
01:37
created

AnnotationCache::delete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
namespace yii\annotations;
3
4
use yii\caching\CacheInterface;
5
6
/**
7
 * Class AnnotationCache
8
 * @package yii\annotations
9
 */
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)
22
    {
23 8
        $this->yiiCache = $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
54
    {
55 1
        return $this->yiiCache->delete($id);
56
    }
57
58
    /**
59
     * {@inheritDoc}
60
     */
61 1
    public function getStats(): ?array
62
    {
63 1
        return null;
64
    }
65
}
66