@@ 238-245 (lines=8) @@ | ||
235 | * @override |
|
236 | * @inheritDoc |
|
237 | */ |
|
238 | public function exists($key) |
|
239 | { |
|
240 | if (!$this->open) |
|
241 | { |
|
242 | return Promise::doReject(new ReadException('Cache object is not open.')); |
|
243 | } |
|
244 | return Promise::doResolve(array_key_exists($key, $this->storage)); |
|
245 | } |
|
246 | ||
247 | /** |
|
248 | * @override |
|
@@ 326-336 (lines=11) @@ | ||
323 | * @override |
|
324 | * @inheritDoc |
|
325 | */ |
|
326 | public function getKeys() |
|
327 | { |
|
328 | if (!$this->open) |
|
329 | { |
|
330 | return Promise::doReject(new ReadException('Cache object is not open.')); |
|
331 | } |
|
332 | return Promise::doResolve(array_keys($this->storage))->then(function($result) { |
|
333 | sort($result); |
|
334 | return $result; |
|
335 | }); |
|
336 | } |
|
337 | ||
338 | /** |
|
339 | * @override |
|
@@ 342-351 (lines=10) @@ | ||
339 | * @override |
|
340 | * @inheritDoc |
|
341 | */ |
|
342 | public function getStats() |
|
343 | { |
|
344 | if (!$this->open) |
|
345 | { |
|
346 | return Promise::doReject(new ReadException('Cache object is not open.')); |
|
347 | } |
|
348 | return Promise::doResolve([ |
|
349 | 'keys' => count($this->storage), |
|
350 | ]); |
|
351 | } |
|
352 | ||
353 | /** |
|
354 | * @override |