diff --git a/RedisCachePool.php b/RedisCachePool.php index a53afb2..b60fd0f 100644 --- a/RedisCachePool.php +++ b/RedisCachePool.php @@ -40,6 +40,9 @@ public function __construct(\Redis $cache) $this->cache = $cache; } + /** + * {@inheritdoc} + */ protected function fetchObjectFromCache($key) { if (false === $result = unserialize($this->cache->get($this->getHierarchyKey($key)))) { @@ -49,11 +52,17 @@ protected function fetchObjectFromCache($key) return $result; } + /** + * {@inheritdoc} + */ protected function clearAllObjectsFromCache() { return $this->cache->flushDb(); } + /** + * {@inheritdoc} + */ protected function clearOneObjectFromCache($key) { $this->commit(); @@ -65,6 +74,9 @@ protected function clearOneObjectFromCache($key) return $this->cache->del($keyString) >= 0; } + /** + * {@inheritdoc} + */ protected function storeItemInCache(CacheItemInterface $item, $ttl) { $key = $this->getHierarchyKey($item->getKey()); @@ -76,6 +88,9 @@ protected function storeItemInCache(CacheItemInterface $item, $ttl) return $this->cache->setex($key, $ttl, $data); } + /** + * {@inheritdoc} + */ public function save(CacheItemInterface $item) { if ($item instanceof TaggableItemInterface) { @@ -85,26 +100,41 @@ public function save(CacheItemInterface $item) return parent::save($item); } + /** + * {@inheritdoc} + */ protected function getValueFormStore($key) { return $this->cache->get($key); } + /** + * {@inheritdoc} + */ protected function appendListItem($name, $value) { $this->cache->lPush($name, $value); } + /** + * {@inheritdoc} + */ protected function getList($name) { return $this->cache->lRange($name, 0, -1); } + /** + * {@inheritdoc} + */ protected function removeList($name) { return $this->cache->del($name); } + /** + * {@inheritdoc} + */ protected function removeListItem($name, $key) { return $this->cache->lrem($name, $key, 0); diff --git a/composer.json b/composer.json index e818e7f..6adc23c 100644 --- a/composer.json +++ b/composer.json @@ -28,13 +28,13 @@ "php": "^5.5|^7.0", "ext-redis": "*", "psr/cache": "^1.0", - "cache/adapter-common": "^0.2", - "cache/taggable-cache": "^0.3", + "cache/adapter-common": "^0.3", + "cache/taggable-cache": "^0.4", "cache/hierarchical-cache": "^0.2" }, "require-dev": { "phpunit/phpunit": "^4.0|^5.1", - "cache/integration-tests": "0.9.0" + "cache/integration-tests": "^0.9" }, "provide": { "psr/cache-implementation": "^1.0"