| 1 | <?php |
||
| 8 | class ResponseCacheRepository |
||
| 9 | { |
||
| 10 | /** @var \Illuminate\Cache\Repository */ |
||
| 11 | protected $cache; |
||
| 12 | |||
| 13 | /** @var \Spatie\ResponseCache\ResponseSerializer */ |
||
| 14 | protected $responseSerializer; |
||
| 15 | |||
| 16 | public function __construct(ResponseSerializer $responseSerializer, Repository $cache) |
||
| 17 | { |
||
| 18 | $this->cache = $cache; |
||
| 19 | |||
| 20 | $this->responseSerializer = $responseSerializer; |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param string $key |
||
| 25 | * @param \Symfony\Component\HttpFoundation\Response $response |
||
| 26 | * @param \DateTime|int $seconds |
||
| 27 | */ |
||
| 28 | public function put(string $key, $response, $seconds) |
||
| 32 | |||
| 33 | public function has(string $key): bool |
||
| 37 | |||
| 38 | public function get(string $key): Response |
||
| 42 | |||
| 43 | public function clear() |
||
| 47 | |||
| 48 | public function forget(string $key): bool |
||
| 52 | } |
||
| 53 |