Completed
Push — master ( eff571...d844b5 )
by Joao
29s
created

NoCacheEngine::lock()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace ByJG\Cache\Engine;
4
5
use ByJG\Cache\CacheEngineInterface;
6
7
class NoCacheEngine implements CacheEngineInterface
8
{
9
10
    /**
11
     * @param string $key The object KEY
12
     * @param int $ttl IGNORED IN MEMCACHED.
13
     * @return object Description
14
     */
15
    public function get($key, $ttl = 0)
16
    {
17
        return null;
18
    }
19
20
    /**
21
     * @param string $key The object Key
22
     * @param object $object The object to be cached
23
     * @param int $ttl The time to live in seconds of this objects
24
     * @return bool If the object is successfully posted
25
     */
26
    public function set($key, $object, $ttl = 0)
27
    {
28
        return true;
29
    }
30
31
    /**
32
     * Unlock resource
33
     * @param string $key
34
     */
35
    public function release($key)
36
    {
37
        return;
38
    }
39
40
    /**
41
     *
42
     * @param string $key
43
     * @param string $str
44
     * @return bool
45
     */
46
    public function append($key, $str)
47
    {
48
        return true;
49
    }
50
51
    /**
52
     * Lock resource before set it.
53
     * @param string $key
54
     */
55
    public function lock($key)
56
    {
57
        return;
58
    }
59
60
    /**
61
     * UnLock resource after set it
62
     * @param string $key
63
     */
64
    public function unlock($key)
65
    {
66
        return;
67
    }
68
69
    public function isAvailable()
70
    {
71
        return true;
72
    }
73
74
75
}
76