Completed
Push — develop ( 8b2ab3...f876c4 )
by
unknown
25:57 queued 17:57
created

ApcuCacheAdapter   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 4
c 1
b 1
f 0
lcom 0
cbo 1
dl 0
loc 44
ccs 8
cts 8
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A has() 0 4 1
A fetch() 0 4 1
A store() 0 4 1
A remove() 0 4 1
1
<?php
2
/**
3
 * @author @ct-jensschulze <[email protected]>
4
 * @created 20.01.15, 13:42
5
 */
6
7
namespace Commercetools\Core\Cache;
8
9
/**
10
 * @package Commercetools\Core\Cache
11
 */
12
class ApcuCacheAdapter extends AbstractCacheAdapter
13
{
14
    /**
15
     * @param $key
16
     * @param null $options
17
     * @return bool|\string[]
18
     */
19 2
    public function has($key, $options = null)
20
    {
21 2
        return apcu_exists($key);
22
    }
23
24
    /**
25
     * @param $key
26
     * @param mixed $options
27
     * @return mixed|false
28
     */
29 4
    public function fetch($key, $options = null)
30
    {
31 4
        return apcu_fetch($key);
32
    }
33
34
    /**
35
     * @param $key
36
     * @param $data
37
     * @param $lifeTime
38
     * @param $options
39
     * @return bool
40
     */
41 8
    public function store($key, $data, $lifeTime = null, $options = null)
42
    {
43 8
        return apcu_store($key, $data, $lifeTime);
44
    }
45
46
    /**
47
     * @param $key
48
     * @param mixed $options
49
     * @return bool
50
     */
51 2
    public function remove($key, $options = null)
52
    {
53 2
        return apcu_delete($key);
54
    }
55
}
56