Total Complexity | 4 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
5 | class ArrayCacheDriver extends AbstractCacheDriver |
||
6 | { |
||
7 | /** |
||
8 | * The data container. |
||
9 | * |
||
10 | * @var array |
||
11 | */ |
||
12 | protected $data; |
||
13 | |||
14 | /** |
||
15 | * Adds a new value to the cache. |
||
16 | * |
||
17 | * @param string $key |
||
18 | * @param mixed $value |
||
19 | * |
||
20 | * @return void |
||
21 | */ |
||
22 | 11 | public function add($key, $value) |
|
23 | { |
||
24 | 11 | $this->data[$key] = serialize($value); |
|
25 | 11 | $this->keys[] = $key; |
|
26 | 11 | } |
|
27 | |||
28 | /** |
||
29 | * Recovers a value from the cache. |
||
30 | * |
||
31 | * @param string $key |
||
32 | * |
||
33 | * @return mixed |
||
34 | */ |
||
35 | 5 | public function get($key) |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * Returns the data property. |
||
42 | * |
||
43 | * @var array |
||
44 | */ |
||
45 | 2 | public function getData() |
|
46 | { |
||
47 | 2 | return $this->data; |
|
48 | } |
||
49 | |||
50 | /** |
||
51 | * Removes a value from the cache. |
||
52 | * |
||
53 | * @param string $key |
||
54 | * |
||
55 | * @return void |
||
56 | */ |
||
57 | 1 | public function remove($key) |
|
60 | 1 | } |
|
61 | } |
||
62 |