Dummy::decrement()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * This file is part of Blitz PHP framework.
5
 *
6
 * (c) 2022 Dimitri Sitchet Tomkeu <[email protected]>
7
 *
8
 * For the full copyright and license information, please view
9
 * the LICENSE file that was distributed with this source code.
10
 */
11
12
namespace BlitzPHP\Cache\Handlers;
13
14
use DateInterval;
15
16
/**
17
 * Moteur de cache nul, toutes les opérations semblent fonctionner, mais ne font rien.
18
 *
19
 * Ceci est utilisé en interne lorsque Cache::disable() a été appelé.
20
 */
21
class Dummy extends BaseHandler
22
{
23
    /**
24
     * {@inheritDoc}
25
     */
26
    public function isSupported(): bool
27
    {
28
        return true;
29
    }
30
31
    /**
32
     * {@inheritDoc}
33
     */
34
    public function init(array $config = []): bool
35
    {
36
        return true;
37
    }
38
39
    /**
40
     * {@inheritDoc}
41
     */
42
    public function set(string $key, mixed $value, null|DateInterval|int $ttl = null): bool
43
    {
44
        return true;
45
    }
46
47
    /**
48
     * {@inheritDoc}
49
     */
50
    public function setMultiple(iterable $values, null|DateInterval|int $ttl = null): bool
51
    {
52
        return true;
53
    }
54
55
    /**
56
     * {@inheritDoc}
57
     */
58
    public function get(string $key, mixed $default = null): mixed
59
    {
60
        return $default;
61
    }
62
63
    /**
64
     * {@inheritDoc}
65
     */
66
    public function getMultiple(iterable $keys, mixed $default = null): iterable
67
    {
68
        return [];
69
    }
70
71
    /**
72
     * {@inheritDoc}
73
     */
74
    public function increment(string $key, int $offset = 1)
75
    {
76
        return 1;
77
    }
78
79
    /**
80
     * {@inheritDoc}
81
     */
82
    public function decrement(string $key, int $offset = 1)
83
    {
84
        return 0;
85
    }
86
87
    /**
88
     * {@inheritDoc}
89
     */
90
    public function delete(string $key): bool
91
    {
92
        return true;
93
    }
94
95
    /**
96
     * {@inheritDoc}
97
     */
98
    public function deleteMultiple(iterable $keys): bool
99
    {
100
        return true;
101
    }
102
103
    /**
104
     * {@inheritDoc}
105
     */
106
    public function clear(): bool
107
    {
108
        return true;
109
    }
110
111
    /**
112
     * {@inheritDoc}
113
     */
114
    public function clearGroup(string $group): bool
115
    {
116
        return true;
117
    }
118
}
119