Code Duplication    Length = 8-11 lines in 3 locations

src/Cache/Cache.php 3 locations

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