ZendCacheAdapter   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 48
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A has() 0 4 1
A get() 0 4 1
A set() 0 4 1
A remove() 0 4 1
1
<?php
2
3
namespace AssetManager\Cache;
4
5
use Assetic\Cache\CacheInterface;
6
use Zend\Cache\Storage\StorageInterface;
7
8
/**
9
 * Zend Cache Storage Adapter for Assetic
10
 */
11
class ZendCacheAdapter implements CacheInterface
12
{
13
14
    /** @var StorageInterface */
15
    protected $zendCache;
16
17
    /**
18
     * Constructor
19
     *
20
     * @param StorageInterface $zendCache Zend Configured Cache Storage
21
     */
22 5
    public function __construct(StorageInterface $zendCache)
23
    {
24 5
        $this->zendCache = $zendCache;
25 5
    }
26
27
    /**
28
     * {@inheritDoc}
29
     */
30 1
    public function has($key)
31
    {
32 1
        return $this->zendCache->hasItem($key);
33
    }
34
35
    /**
36
     * {@inheritDoc}
37
     */
38 1
    public function get($key)
39
    {
40 1
        return $this->zendCache->getItem($key);
41
    }
42
43
    /**
44
     * {@inheritDoc}
45
     */
46 1
    public function set($key, $value)
47
    {
48 1
        return $this->zendCache->setItem($key, $value);
49
    }
50
51
    /**
52
     * {@inheritDoc}
53
     */
54 1
    public function remove($key)
55
    {
56 1
        return $this->zendCache->removeItem($key);
57
    }
58
}
59