1 | <?php |
||
20 | class ArrayCache extends TaggableCache |
||
21 | { |
||
22 | use MultiCacheTrait; |
||
23 | |||
24 | /** |
||
25 | * Stored items |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | private $items = []; |
||
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | 1 | public function set($key, $value, $timeToLive = null) |
|
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | 1 | public function has($key) |
|
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | 1 | public function get($key, $default = null) |
|
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | 1 | public function demand($key) |
|
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | 1 | public function delete($key) |
|
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | */ |
||
106 | 1 | public function flush() |
|
112 | |||
113 | /** |
||
114 | * Checks whether an item as expired |
||
115 | * |
||
116 | * @param string $key |
||
117 | * |
||
118 | * @return bool |
||
119 | */ |
||
120 | 1 | private function hasExpired($key) |
|
124 | |||
125 | /** |
||
126 | * Gets the remaining time to live for an item |
||
127 | * |
||
128 | * @param $key |
||
129 | * |
||
130 | * @return int|null |
||
131 | */ |
||
132 | 1 | public function getTimeToLive($key) |
|
140 | } |
||
141 |