VoidCache   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 7
c 2
b 0
f 0
dl 0
loc 48
ccs 12
cts 12
cp 1
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A doSave() 0 3 1
A doContains() 0 3 1
A doDelete() 0 3 1
A doFetch() 0 3 1
A doFlush() 0 3 1
A doGetStats() 0 3 1
1
<?php
2
3
namespace Doctrine\Common\Cache;
4
5
/**
6
 * Void cache driver. The cache could be of use in tests where you don`t need to cache anything.
7
 *
8
 * @link   www.doctrine-project.org
9
 */
10
class VoidCache extends CacheProvider
11
{
12
    /**
13
     * {@inheritDoc}
14
     */
15 4
    protected function doFetch($id)
16
    {
17 4
        return false;
18
    }
19
20
    /**
21
     * {@inheritDoc}
22
     */
23 2
    protected function doContains($id)
24
    {
25 2
        return false;
26
    }
27
28
    /**
29
     * {@inheritDoc}
30
     */
31 1
    protected function doSave($id, $data, $lifeTime = 0)
32
    {
33 1
        return true;
34
    }
35
36
    /**
37
     * {@inheritDoc}
38
     */
39 1
    protected function doDelete($id)
40
    {
41 1
        return true;
42
    }
43
44
    /**
45
     * {@inheritDoc}
46
     */
47 1
    protected function doFlush()
48
    {
49 1
        return true;
50
    }
51
52
    /**
53
     * {@inheritDoc}
54
     */
55 1
    protected function doGetStats()
56
    {
57 1
        return;
58
    }
59
}
60