Completed
Push — master ( ecfeff...c95134 )
by
unknown
01:46
created

NullCache::increment()   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
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Vectorface\Cache;
4
5
/**
6
 * A cache that caches nothing and always fails.
7
 */
8
class NullCache implements Cache, AtomicCounter
9
{
10
    /**
11
     * @inheritDoc
12
     */
13 3
    public function get($key, $default = null)
14
    {
15 3
        return $default;
16
    }
17
18
    /**
19
     * @inheritDoc
20
     */
21 4
    public function set($key, $value, $ttl = null)
22
    {
23 4
        return false;
24
    }
25
26
    /**
27
     * @inheritDoc
28
     */
29 3
    public function delete($key)
30
    {
31 3
        return false;
32
    }
33
34
    /**
35
     * @inheritDoc
36
     */
37 3
    public function clean()
38
    {
39 3
        return false;
40
    }
41
42
    /**
43
     * @inheritDoc
44
     */
45 3
    public function flush()
46
    {
47 3
        return false;
48
    }
49
50
    /**
51
     * @inheritDoc
52
     */
53 1
    public function clear()
54
    {
55 1
        return false;
56
    }
57
58
    /**
59
     * @inheritDoc
60
     */
61 2
    public function getMultiple($keys, $default = null)
62
    {
63 2
        $defaults = [];
64 2
        foreach ($keys as $key) {
65 2
            $defaults[$key] = $default;
66
        }
67 2
        return $defaults;
68
    }
69
70
    /**
71
     * @inheritDoc
72
     */
73 2
    public function setMultiple($values, $ttl = null)
74
    {
75 2
        return false;
76
    }
77
78
    /**
79
     * @inheritDoc
80
     */
81 2
    public function deleteMultiple($keys)
82
    {
83 2
        return false;
84
    }
85
86
    /**
87
     * @inheritDoc
88
     */
89 1
    public function has($key)
90
    {
91 1
        return false;
92
    }
93
94
    /**
95
     * @inheritDoc
96
     */
97 2
    public function increment($key, $step = 1)
98
    {
99 2
        return false;
100
    }
101
102
    /**
103
     * @inheritDoc
104
     */
105 2
    public function decrement($key, $step = 1)
106
    {
107 2
        return false;
108
    }
109
}
110