Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
94.44% |
17 / 18 |
|
94.44% |
17 / 18 |
CRAP | |
0.00% |
0 / 1 |
NullCache | |
94.44% |
17 / 18 |
|
94.44% |
17 / 18 |
18.06 | |
0.00% |
0 / 1 |
connect | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
set | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
increment | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
decrement | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
add | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
get | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
delete | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
flush | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
flushAll | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
replace | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
stats | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getThreshold | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
exists | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
rename | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getLike | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
deleteLike | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
updateExpire | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
jsonSerialize | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * Jingga |
4 | * |
5 | * PHP Version 8.1 |
6 | * |
7 | * @package phpOMS\DataStorage\Cache\Connection |
8 | * @copyright Dennis Eichhorn |
9 | * @license OMS License 2.0 |
10 | * @version 1.0.0 |
11 | * @link https://jingga.app |
12 | */ |
13 | declare(strict_types=1); |
14 | |
15 | namespace phpOMS\DataStorage\Cache\Connection; |
16 | |
17 | /** |
18 | * Null cache class. |
19 | * |
20 | * @package phpOMS\DataStorage\Cache\Connection |
21 | * @license OMS License 2.0 |
22 | * @link https://jingga.app |
23 | * @since 1.0.0 |
24 | */ |
25 | final class NullCache extends ConnectionAbstract |
26 | { |
27 | /** |
28 | * {@inheritdoc} |
29 | */ |
30 | public function connect(array $data = null) : void |
31 | { |
32 | } |
33 | |
34 | /** |
35 | * {@inheritdoc} |
36 | */ |
37 | public function set(int | string $key, mixed $value, int $expire = -1) : void |
38 | { |
39 | } |
40 | |
41 | /** |
42 | * {@inheritdoc} |
43 | */ |
44 | public function increment(int | string $key, int $value = 1) : bool |
45 | { |
46 | return true; |
47 | } |
48 | |
49 | /** |
50 | * {@inheritdoc} |
51 | */ |
52 | public function decrement(int | string $key, int $value = 1) : bool |
53 | { |
54 | return true; |
55 | } |
56 | |
57 | /** |
58 | * {@inheritdoc} |
59 | */ |
60 | public function add(int | string $key, mixed $value, int $expire = -1) : bool |
61 | { |
62 | return true; |
63 | } |
64 | |
65 | /** |
66 | * {@inheritdoc} |
67 | */ |
68 | public function get(int | string $key, int $expire = -1) : mixed |
69 | { |
70 | return null; |
71 | } |
72 | |
73 | /** |
74 | * {@inheritdoc} |
75 | */ |
76 | public function delete(int | string $key, int $expire = -1) : bool |
77 | { |
78 | return true; |
79 | } |
80 | |
81 | /** |
82 | * {@inheritdoc} |
83 | */ |
84 | public function flush(int $expire = 0) : bool |
85 | { |
86 | return true; |
87 | } |
88 | |
89 | /** |
90 | * {@inheritdoc} |
91 | */ |
92 | public function flushAll() : bool |
93 | { |
94 | return true; |
95 | } |
96 | |
97 | /** |
98 | * {@inheritdoc} |
99 | */ |
100 | public function replace(int | string $key, mixed $value, int $expire = -1) : bool |
101 | { |
102 | return true; |
103 | } |
104 | |
105 | /** |
106 | * {@inheritdoc} |
107 | */ |
108 | public function stats() : array |
109 | { |
110 | return []; |
111 | } |
112 | |
113 | /** |
114 | * {@inheritdoc} |
115 | */ |
116 | public function getThreshold() : int |
117 | { |
118 | return 0; |
119 | } |
120 | |
121 | /** |
122 | * {@inheritdoc} |
123 | */ |
124 | public function exists(int | string $key, int $expire = -1) : bool |
125 | { |
126 | return false; |
127 | } |
128 | |
129 | /** |
130 | * {@inheritdoc} |
131 | */ |
132 | public function rename(int | string $old, int | string $new, int $expire = -1) : bool |
133 | { |
134 | return true; |
135 | } |
136 | |
137 | /** |
138 | * {@inheritdoc} |
139 | */ |
140 | public function getLike(string $pattern, int $expire = -1) : array |
141 | { |
142 | return []; |
143 | } |
144 | |
145 | /** |
146 | * {@inheritdoc} |
147 | */ |
148 | public function deleteLike(string $pattern, int $expire = -1) : bool |
149 | { |
150 | return true; |
151 | } |
152 | |
153 | /** |
154 | * {@inheritdoc} |
155 | */ |
156 | public function updateExpire(int | string $key, int $expire = -1) : bool |
157 | { |
158 | return true; |
159 | } |
160 | |
161 | /** |
162 | * {@inheritdoc} |
163 | */ |
164 | public function jsonSerialize() : mixed |
165 | { |
166 | return ['id' => $this->id]; |
167 | } |
168 | } |