Passed
Pull Request — master (#31)
by Alexander
01:41
created

FalseCache::clear()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Yiisoft\Cache\Tests;
4
5
use Psr\SimpleCache\CacheInterface;
6
7
/**
8
 * FalseCache does not cache anything reporting failure for all methods calls.
9
 */
10
final class FalseCache implements CacheInterface
11
{
12
    public function get($key, $default = null)
13
    {
14
        return null;
15
    }
16
17
    public function set($key, $value, $ttl = null): bool
18
    {
19
        return false;
20
    }
21
22
    public function delete($key): bool
23
    {
24
        return false;
25
    }
26
27
    public function clear(): bool
28
    {
29
        return false;
30
    }
31
32
    public function getMultiple($keys, $default = null): iterable
33
    {
34
        return [];
35
    }
36
37
    public function setMultiple($values, $ttl = null): bool
38
    {
39
        return false;
40
    }
41
42
    public function deleteMultiple($keys): bool
43
    {
44
        return false;
45
    }
46
47
    public function has($key): bool
48
    {
49
        return false;
50
    }
51
}
52