47175ff20e3e3b6070104035f21215d233fcce5f
[m6w6/seekat] / lib / API / Call / Cache / Service / Hollow.php
1 <?php
2
3 namespace seekat\API\Call\Cache\Service;
4
5 use http\Client\Response;
6 use seekat\API\Call\Cache\Service;
7
8 final class Hollow implements Service
9 {
10 private $storage = [];
11
12 public function fetch(string $key, Response &$response = null) : bool {
13 if (isset($this->storage[$key])) {
14 $response = $this->storage[$key];
15 return true;
16 }
17 return false;
18 }
19
20 public function store(string $key, Response $response) : bool {
21 $this->storage[$key] = $response;
22 return true;
23 }
24
25 public function clear() {
26 $this->storage = [];
27 }
28
29 public function getStorage() : array {
30 return $this->storage;
31 }
32 }