DefaultCacheAdapter   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 66
ccs 17
cts 17
cp 1
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getItem() 0 4 1
A getItems() 0 4 1
A clear() 0 4 1
A deleteItems() 0 4 1
A save() 0 4 1
A saveDeferred() 0 4 1
A commit() 0 4 1
1
<?php
2
/*
3
 * This file is part of the Egils\Component\Cache package.
4
 *
5
 * (c) Egidijus Lukauskas <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Egils\Component\Cache\Adapter;
12
13
use Psr\Cache\CacheItemInterface;
14
use Psr\Cache\CacheItemPoolInterface;
15
16
class DefaultCacheAdapter implements CacheItemPoolInterface
17
{
18
    /** @var CacheItemPoolInterface */
19
    private $defaultAdapter;
20
21 7
    public function __construct(CacheItemPoolInterface $cacheItemPool)
22
    {
23 7
        $this->defaultAdapter = $cacheItemPool;
24 7
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 1
    public function getItem($key)
30
    {
31 1
        return $this->defaultAdapter->getItem($key);
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37 1
    public function getItems(array $keys = [])
38
    {
39 1
        return $this->defaultAdapter->getItems($keys);
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45 1
    public function clear()
46
    {
47 1
        return $this->defaultAdapter->clear();
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53 1
    public function deleteItems(array $keys)
54
    {
55 1
        return $this->defaultAdapter->deleteItems($keys);
56
    }
57
58
    /**
59
     * {@inheritdoc}
60
     */
61 1
    public function save(CacheItemInterface $item)
62
    {
63 1
        return $this->defaultAdapter->save($item);
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69 1
    public function saveDeferred(CacheItemInterface $item)
70
    {
71 1
        return $this->defaultAdapter->saveDeferred($item);
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77 1
    public function commit()
78
    {
79 1
        return $this->defaultAdapter->commit();
80
    }
81
}
82