NullStore::delete()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
/**
3
 * Null (fake) Store.
4
 *
5
 * @package SugiPHP.Cache
6
 * @author  Plamen Popov <[email protected]>
7
 * @license http://opensource.org/licenses/mit-license.php (MIT License)
8
 */
9
10
namespace SugiPHP\Cache;
11
12
/**
13
 * Null Store
14
 * This is actually a fake store. It is used to check your code is not breaking
15
 * if there is no other storages available, or if there is a problem with existing
16
 * ones, e.g. no space left on the server or there is no connection with Memcached.
17
 * Other use is when you wish your code to work without any caching for a while.
18
 */
19
class NullStore implements StoreInterface
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function add($key, $value, $ttl = 0)
25
    {
26
        return false;
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function set($key, $value, $ttl = 0)
33
    {
34
        return false;
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function get($key)
41
    {
42
        return null;
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function has($key)
49
    {
50
        return false;
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function delete($key)
57
    {
58
        //
59
    }
60
61
    /**
62
     * {@inheritdoc}
63
     */
64
    public function flush()
65
    {
66
        //
67
    }
68
}
69