X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fseekat;a=blobdiff_plain;f=lib%2FAPI%2FCall%2FCache%2FService%2FItemPool.php;fp=lib%2FAPI%2FCall%2FCache%2FService%2FItemPool.php;h=264cfbd173ea4414eaeeb36324333ab38a0f3c29;hp=63f12de84fc9d7971c0265a62e9c1c3f8c3bf2e2;hb=2121556150be871684b5046af7cf250b8219128d;hpb=cac6bea94e6cde142c951566fa6387ffa54eb3cb diff --git a/lib/API/Call/Cache/Service/ItemPool.php b/lib/API/Call/Cache/Service/ItemPool.php index 63f12de..264cfbd 100644 --- a/lib/API/Call/Cache/Service/ItemPool.php +++ b/lib/API/Call/Cache/Service/ItemPool.php @@ -7,8 +7,7 @@ use Psr\Cache\CacheItemInterface; use Psr\Cache\CacheItemPoolInterface; use seekat\API\Call\Cache\Service; -final class ItemPool implements Service -{ +final class ItemPool implements Service { /** * @var CacheItemPoolInterface */ @@ -23,6 +22,12 @@ final class ItemPool implements Service $this->cache = $cache; } + /** + * @param string $key + * @param Response|null $response + * @return bool + * @throws \Psr\Cache\InvalidArgumentException + */ public function fetch(string $key, Response &$response = null) : bool { $this->item = $this->cache->getItem($key); if ($this->item->isHit()) { @@ -37,6 +42,14 @@ final class ItemPool implements Service return $this->cache->save($this->item); } + /** + * @param string $key + * @throws \Psr\Cache\InvalidArgumentException + */ + public function del(string $key) { + $this->cache->deleteItem($key); + } + public function clear() { $this->cache->clear(); }