use Psr\Cache\CacheItemPoolInterface;
use seekat\API\Call\Cache\Service;
-final class ItemPool implements Service
-{
+final class ItemPool implements Service {
/**
* @var CacheItemPoolInterface
*/
$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()) {
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();
}