3 namespace seekat\API\Call\Cache\Service
;
5 use http\Client\Response
;
6 use Psr\SimpleCache\CacheInterface
;
7 use seekat\API\Call\Cache\Service
;
9 final class Simple
implements Service
{
15 public function __construct(CacheInterface
$cache) {
16 $this->cache
= $cache;
19 public function fetch(string $key, Response
&$response = null) : bool {
20 $response = $this->cache
->get($key);
24 public function store(string $key, Response
$response) : bool {
25 return $this->cache
->set($key, $response);
28 public function del(string $key) {
29 $this->cache
->delete($key);
32 public function clear() {
33 $this->cache
->clear();