item = $this->cache->getItem($key); if ($this->item->isHit()) { $response = $this->item->get(); return true; } return false; } public function store(string $key, Response $response) : bool { $this->item->set($response); return $this->cache->save($this->item); } /** * @param string $key * @throws \Psr\Cache\InvalidArgumentException */ public function del(string $key) : void { $this->cache->deleteItem($key); } public function clear() : void { $this->cache->clear(); } }