Completed
Pull Request — master (#81)
by Greg
02:12
created

NullCache   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 31
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A has() 0 4 1
A get() 0 4 1
A set() 0 3 1
1
<?php
2
namespace Consolidation\AnnotatedCommand\Cache;
3
4
/**
5
 * An empty cache that never stores or fetches any objects.
6
 */
7
class NullCache implements SimpleCacheInterface
8
{
9
    /**
10
     * Test for an entry from the cache
11
     * @param string $key
12
     * @return boolean
13
     */
14
    public function has($key)
15
    {
16
        return false;
17
    }
18
19
    /**
20
     * Get an entry from the cache
21
     * @param string $key
22
     * @return array
23
     */
24
    public function get($key)
25
    {
26
        return [];
27
    }
28
29
    /**
30
     * Store an entry in the cache
31
     * @param string $key
32
     * @param array $data
33
     */
34
    public function set($key, $data)
35
    {
36
    }
37
}
38