Total Complexity | 6 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | class RequestCache |
||
18 | { |
||
19 | private StorageInterface $storage; |
||
20 | |||
21 | public function __construct(StorageInterface $storage) |
||
22 | { |
||
23 | $this->storage = $storage; |
||
24 | } |
||
25 | |||
26 | public function clearAll(string $commandKey): void |
||
27 | { |
||
28 | $this->storage->removeBucket($commandKey); |
||
29 | } |
||
30 | |||
31 | public function clear(string $commandKey, string $cacheKey): void |
||
32 | { |
||
33 | $this->storage->remove($commandKey, $cacheKey); |
||
34 | } |
||
35 | |||
36 | public function get(string $commandKey, string $cacheKey) |
||
37 | { |
||
38 | return $this->storage->get($commandKey, $cacheKey); |
||
39 | } |
||
40 | |||
41 | public function put(string $commandKey, string $cacheKey, $value, int $expiresAfterSeconds): void |
||
42 | { |
||
43 | $this->storage->set($commandKey, $cacheKey, $value, $expiresAfterSeconds); |
||
44 | } |
||
45 | |||
46 | public function exists(string $commandKey, string $cacheKey): bool |
||
49 | } |
||
50 | } |
||
51 |