1 | <?php |
||
17 | class ArrayCache implements Cache |
||
18 | { |
||
19 | /** |
||
20 | * Stored items |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | private $items = []; |
||
25 | |||
26 | /** |
||
27 | * {@inheritdoc} |
||
28 | */ |
||
29 | public function delete($key) |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | public function set($key, $value, $timeToLive = 0) |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | public function has($key) |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | public function get($key) |
||
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | public function pull($key, $default = null) |
||
91 | |||
92 | /** |
||
93 | * Checks whether an item as expired |
||
94 | * |
||
95 | * @param string $key |
||
96 | * |
||
97 | * @return bool |
||
98 | */ |
||
99 | private function hasExpired($key) |
||
103 | } |
||
104 |