1 | <?php |
||
11 | class CacheItemPool implements CacheItemPoolInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var \Illuminate\Contracts\Cache\Repository |
||
15 | */ |
||
16 | private $repository; |
||
17 | |||
18 | /** |
||
19 | * @var \Psr\Cache\CacheItemInterface[] |
||
20 | */ |
||
21 | private $deferred = []; |
||
22 | |||
23 | /** |
||
24 | * @param \Illuminate\Contracts\Cache\Repository $repository |
||
25 | */ |
||
26 | 141 | public function __construct(Repository $repository) |
|
30 | |||
31 | /** |
||
32 | * Destructor. |
||
33 | */ |
||
34 | 23 | public function __destruct() |
|
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | 76 | public function getItem($key) |
|
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public function getItems(array $keys = array()) |
||
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | */ |
||
68 | 34 | public function hasItem($key) |
|
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | 121 | public function clear() |
|
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | */ |
||
106 | 26 | public function deleteItem($key) |
|
118 | |||
119 | /** |
||
120 | * {@inheritdoc} |
||
121 | */ |
||
122 | 22 | public function deleteItems(array $keys) |
|
137 | |||
138 | /** |
||
139 | * {@inheritdoc} |
||
140 | */ |
||
141 | 35 | public function save(CacheItemInterface $item) |
|
174 | |||
175 | /** |
||
176 | * {@inheritdoc} |
||
177 | */ |
||
178 | 12 | public function saveDeferred(CacheItemInterface $item) |
|
192 | |||
193 | /** |
||
194 | * {@inheritdoc} |
||
195 | */ |
||
196 | 31 | public function commit() |
|
208 | |||
209 | /** |
||
210 | * @param string $key |
||
211 | * |
||
212 | * @throws \Psr\Cache\InvalidArgumentException |
||
213 | */ |
||
214 | 135 | private function validateKey($key) |
|
220 | |||
221 | /** |
||
222 | * @param \Madewithlove\IlluminatePsrCacheBridge\Laravel\CacheItem $item |
||
223 | * |
||
224 | * @return \DateTimeInterface |
||
225 | */ |
||
226 | 38 | private function getExpiresAt(CacheItem $item) |
|
230 | } |
||
231 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.