1 | <?php |
||
13 | final class SimpleCacheAdapter implements PsrCache |
||
14 | { |
||
15 | /** |
||
16 | * @var DoctrineCache|ClearableCache|MultiGetCache|MultiPutCache |
||
17 | */ |
||
18 | private $doctrineCache; |
||
19 | |||
20 | /** |
||
21 | * @param DoctrineCache $doctrineCache |
||
22 | * @throws \Roave\DoctrineSimpleCache\Exception\CacheException |
||
23 | */ |
||
24 | 60 | public function __construct(DoctrineCache $doctrineCache) |
|
38 | |||
39 | /** |
||
40 | * @param mixed $key |
||
41 | * @throws \Roave\DoctrineSimpleCache\Exception\InvalidArgumentException |
||
42 | */ |
||
43 | 54 | private function validateKey($key) : void |
|
57 | |||
58 | /** |
||
59 | * @param mixed $keys |
||
60 | * @return array |
||
61 | * @throws \Roave\DoctrineSimpleCache\Exception\InvalidArgumentException |
||
62 | */ |
||
63 | 27 | private function filterValidateMultipleKeys($keys) : array |
|
77 | |||
78 | /** |
||
79 | * {@inheritDoc} |
||
80 | */ |
||
81 | 5 | public function get($key, $default = null) |
|
92 | |||
93 | /** |
||
94 | * {@inheritDoc} |
||
95 | */ |
||
96 | 14 | public function set($key, $value, $ttl = null) : bool |
|
118 | |||
119 | /** |
||
120 | * {@inheritDoc} |
||
121 | */ |
||
122 | 5 | public function delete($key) : bool |
|
127 | |||
128 | /** |
||
129 | * {@inheritDoc} |
||
130 | */ |
||
131 | 1 | public function clear() : bool |
|
135 | |||
136 | /** |
||
137 | * @param array|\Traversable $keys |
||
138 | * @param mixed $default |
||
139 | * @return array |
||
140 | * @throws \Roave\DoctrineSimpleCache\Exception\InvalidArgumentException |
||
141 | */ |
||
142 | 24 | public function getMultiple($keys, $default = null) |
|
147 | |||
148 | /** |
||
149 | * @param array|\Traversable $values |
||
150 | * @param null|int|\DateInterval $ttl |
||
151 | * @return bool |
||
152 | * @throws \Roave\DoctrineSimpleCache\Exception\InvalidArgumentException |
||
153 | */ |
||
154 | 15 | public function setMultiple($values, $ttl = null) : bool |
|
182 | |||
183 | /** |
||
184 | * @param array|\Traversable $keys |
||
185 | * @return bool |
||
186 | * @throws \Roave\DoctrineSimpleCache\Exception\InvalidArgumentException |
||
187 | */ |
||
188 | 3 | public function deleteMultiple($keys) : bool |
|
201 | |||
202 | /** |
||
203 | * {@inheritDoc} |
||
204 | */ |
||
205 | 1 | public function has($key) : bool |
|
210 | |||
211 | 2 | private function convertDateIntervalToInteger(\DateInterval $ttl) : int |
|
219 | } |
||
220 |
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: