Skip to content

Commit c49b223

Browse files
committed
Tagging bugfix and updated tests to ^0.9
1 parent 8c89807 commit c49b223

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

PredisCachePool.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public function __construct(Client $cache)
4141
$this->cache = $cache;
4242
}
4343

44+
/**
45+
* {@inheritdoc}
46+
*/
4447
public function save(CacheItemInterface $item)
4548
{
4649
if ($item instanceof TaggableItemInterface) {
@@ -50,6 +53,9 @@ public function save(CacheItemInterface $item)
5053
return parent::save($item);
5154
}
5255

56+
/**
57+
* {@inheritdoc}
58+
*/
5359
protected function fetchObjectFromCache($key)
5460
{
5561
if (false === $result = unserialize($this->cache->get($this->getHierarchyKey($key)))) {
@@ -59,11 +65,17 @@ protected function fetchObjectFromCache($key)
5965
return $result;
6066
}
6167

68+
/**
69+
* {@inheritdoc}
70+
*/
6271
protected function clearAllObjectsFromCache()
6372
{
6473
return 'OK' === $this->cache->flushdb()->getPayload();
6574
}
6675

76+
/**
77+
* {@inheritdoc}
78+
*/
6779
protected function clearOneObjectFromCache($key)
6880
{
6981
// We have to commit here to be able to remove deferred hierarchy items
@@ -77,6 +89,9 @@ protected function clearOneObjectFromCache($key)
7789
return $this->cache->del($keyString) >= 0;
7890
}
7991

92+
/**
93+
* {@inheritdoc}
94+
*/
8095
protected function storeItemInCache(CacheItemInterface $item, $ttl)
8196
{
8297
if ($ttl < 0) {
@@ -93,26 +108,41 @@ protected function storeItemInCache(CacheItemInterface $item, $ttl)
93108
return 'OK' === $this->cache->setex($key, $ttl, $data)->getPayload();
94109
}
95110

111+
/**
112+
* {@inheritdoc}
113+
*/
96114
protected function getValueFormStore($key)
97115
{
98116
return $this->cache->get($key);
99117
}
100118

119+
/**
120+
* {@inheritdoc}
121+
*/
101122
protected function appendListItem($name, $value)
102123
{
103124
$this->cache->lpush($name, $value);
104125
}
105126

127+
/**
128+
* {@inheritdoc}
129+
*/
106130
protected function getList($name)
107131
{
108132
return $this->cache->lrange($name, 0, -1);
109133
}
110134

135+
/**
136+
* {@inheritdoc}
137+
*/
111138
protected function removeList($name)
112139
{
113140
return $this->cache->del($name);
114141
}
115142

143+
/**
144+
* {@inheritdoc}
145+
*/
116146
protected function removeListItem($name, $key)
117147
{
118148
return $this->cache->lrem($name, 0, $key);

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
"require": {
2828
"php": "^5.5|^7.0",
2929
"psr/cache": "^1.0",
30-
"cache/adapter-common": "^0.2",
31-
"cache/taggable-cache": "^0.3",
30+
"cache/adapter-common": "^0.3",
31+
"cache/taggable-cache": "^0.4",
3232
"cache/hierarchical-cache": "^0.2",
3333
"predis/predis": "^1.0"
3434
},
3535
"require-dev": {
3636
"phpunit/phpunit": "^4.0|^5.1",
37-
"cache/integration-tests": "0.9.0"
37+
"cache/integration-tests": "^0.9"
3838
},
3939
"provide": {
4040
"psr/cache-implementation": "^1.0"

0 commit comments

Comments
 (0)