| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | interface CacheInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * The maximum ttl for cached responses (24 hours). |
||
| 15 | * |
||
| 16 | * @const integer |
||
| 17 | */ |
||
| 18 | const MAX_TTL = 86400; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Store the api $response as the cached result of the api $request. |
||
| 22 | * |
||
| 23 | * @param RequestInterface $request The request for which the response will be cached. |
||
| 24 | * @param ResponseInterface $response The reponse to cache. |
||
| 25 | * @param integer $timeToLive The time in seconds that the cache should live. |
||
| 26 | * |
||
| 27 | * @return void |
||
| 28 | */ |
||
| 29 | public function set(RequestInterface $request, ResponseInterface $response, int $timeToLive = null); |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Retrieve the cached results of the api $request. |
||
| 33 | * |
||
| 34 | * @param RequestInterface $request A request for which the response may be cached. |
||
| 35 | * |
||
| 36 | * @return ResponseInterface|null |
||
| 37 | */ |
||
| 38 | public function get(RequestInterface $request); |
||
| 39 | } |
||
| 40 |