@@ 249-256 (lines=8) @@ | ||
246 | * @override |
|
247 | * @inheritDoc |
|
248 | */ |
|
249 | public function exists($key) |
|
250 | { |
|
251 | if (!$this->open) |
|
252 | { |
|
253 | return Promise::doReject(new ReadException('Cache object is not open.')); |
|
254 | } |
|
255 | return Promise::doResolve(array_key_exists($key, $this->storage)); |
|
256 | } |
|
257 | ||
258 | /** |
|
259 | * @override |
|
@@ 337-347 (lines=11) @@ | ||
334 | * @override |
|
335 | * @inheritDoc |
|
336 | */ |
|
337 | public function getKeys() |
|
338 | { |
|
339 | if (!$this->open) |
|
340 | { |
|
341 | return Promise::doReject(new ReadException('Cache object is not open.')); |
|
342 | } |
|
343 | return Promise::doResolve(array_keys($this->storage))->then(function($result) { |
|
344 | sort($result); |
|
345 | return $result; |
|
346 | }); |
|
347 | } |
|
348 | ||
349 | /** |
|
350 | * @override |
|
@@ 353-362 (lines=10) @@ | ||
350 | * @override |
|
351 | * @inheritDoc |
|
352 | */ |
|
353 | public function getStats() |
|
354 | { |
|
355 | if (!$this->open) |
|
356 | { |
|
357 | return Promise::doReject(new ReadException('Cache object is not open.')); |
|
358 | } |
|
359 | return Promise::doResolve([ |
|
360 | 'keys' => count($this->storage), |
|
361 | ]); |
|
362 | } |
|
363 | ||
364 | /** |
|
365 | * @override |