1 | <?php |
||
12 | final class SimpleCacheAdapter implements PsrCache |
||
13 | { |
||
14 | /** |
||
15 | * @var DoctrineCache|ClearableCache|MultiOperationCache |
||
16 | */ |
||
17 | private $doctrineCache; |
||
18 | |||
19 | /** |
||
20 | * @param DoctrineCache $doctrineCache |
||
21 | * @throws \Roave\DoctrineSimpleCache\Exception\CacheException |
||
22 | */ |
||
23 | 62 | public function __construct(DoctrineCache $doctrineCache) |
|
35 | |||
36 | /** |
||
37 | * @param mixed $key |
||
38 | * @throws \Roave\DoctrineSimpleCache\Exception\InvalidArgumentException |
||
39 | */ |
||
40 | 57 | private function validateKey($key) : void |
|
54 | |||
55 | /** |
||
56 | * @param mixed $keys |
||
57 | * @return array |
||
58 | * @throws \Roave\DoctrineSimpleCache\Exception\InvalidArgumentException |
||
59 | */ |
||
60 | 28 | private function filterValidateMultipleKeys($keys) : array |
|
74 | |||
75 | /** |
||
76 | * {@inheritDoc} |
||
77 | */ |
||
78 | 7 | public function get($key, $default = null) |
|
94 | |||
95 | /** |
||
96 | * {@inheritDoc} |
||
97 | */ |
||
98 | 15 | public function set($key, $value, $ttl = null) : bool |
|
120 | |||
121 | /** |
||
122 | * {@inheritDoc} |
||
123 | */ |
||
124 | 2 | public function delete($key) : bool |
|
129 | |||
130 | /** |
||
131 | * {@inheritDoc} |
||
132 | */ |
||
133 | 1 | public function clear() : bool |
|
137 | |||
138 | /** |
||
139 | * @param array|\Traversable $keys |
||
140 | * @param mixed $default |
||
141 | * @return array |
||
142 | * @throws \Roave\DoctrineSimpleCache\Exception\InvalidArgumentException |
||
143 | */ |
||
144 | 25 | public function getMultiple($keys, $default = null) : array |
|
149 | |||
150 | /** |
||
151 | * @param array|\Traversable $values |
||
152 | * @param null|int|\DateInterval $ttl |
||
153 | * @return bool |
||
154 | * @throws \Roave\DoctrineSimpleCache\Exception\InvalidArgumentException |
||
155 | * @throws \Exception |
||
156 | */ |
||
157 | 17 | public function setMultiple($values, $ttl = null) : bool |
|
187 | |||
188 | /** |
||
189 | * @param array|\Traversable $keys |
||
190 | * @return bool |
||
191 | * @throws \Roave\DoctrineSimpleCache\Exception\InvalidArgumentException |
||
192 | */ |
||
193 | 3 | public function deleteMultiple($keys) : bool |
|
197 | |||
198 | /** |
||
199 | * {@inheritDoc} |
||
200 | */ |
||
201 | 1 | public function has($key) : bool |
|
206 | |||
207 | /** |
||
208 | * @throws \Exception |
||
209 | */ |
||
210 | 2 | private function convertDateIntervalToInteger(\DateInterval $ttl) : int |
|
218 | } |
||
219 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: