1 | <?php |
||
15 | final class MongoCache extends AbstractCache implements CacheInterface |
||
16 | { |
||
17 | /** |
||
18 | * MongoCollection containing the cached responses. |
||
19 | * |
||
20 | * @var \MongoCollection |
||
21 | */ |
||
22 | private $collection; |
||
23 | |||
24 | /** |
||
25 | * Construct a new instance of MongoCache. |
||
26 | * |
||
27 | * @param Collection $collection The collection containing the cached data. |
||
28 | * @param integer $defaultTimeToLive The default time to live in seconds. |
||
29 | */ |
||
30 | public function __construct(Collection $collection, $defaultTimeToLive = CacheInterface::MAX_TTL) |
||
36 | |||
37 | /** |
||
38 | * Store the api $response as the cached result of the api $request. |
||
39 | * |
||
40 | * @param RequestInterface $request The request for which the response will be cached. |
||
41 | * @param ResponseInterface $response The reponse to cache. |
||
42 | * @param integer $timeToLive The time in seconds that the cache should live. |
||
43 | * |
||
44 | * @return void |
||
45 | * |
||
46 | * @throws \InvalidArgumentException Throw if $timeToLive is not an integer between 0 and 86400. |
||
47 | */ |
||
48 | public function set(RequestInterface $request, ResponseInterface $response, $timeToLive = null) |
||
63 | |||
64 | /** |
||
65 | * Retrieve the cached results of the api $request. |
||
66 | * |
||
67 | * @param RequestInterface $request A request for which the response may be cached. |
||
68 | * |
||
69 | * @return ResponseInterface|null |
||
70 | */ |
||
71 | public function get(RequestInterface $request) |
||
90 | } |
||
91 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..