Passed
Push — redis ( 69cfbf...5e7e33 )
by Francis
10:01
created

NullCache::increment()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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