1 | <?php |
||
12 | final class SimpleCacheAdapter implements PsrCache |
||
13 | { |
||
14 | /** |
||
15 | * @var DoctrineCache|ClearableCache|MultiGetCache|MultiPutCache |
||
16 | */ |
||
17 | private $doctrineCache; |
||
18 | |||
19 | /** |
||
20 | * @param DoctrineCache $doctrineCache |
||
21 | * @throws \Roave\DoctrineSimpleCache\CacheException |
||
22 | */ |
||
23 | 36 | public function __construct(DoctrineCache $doctrineCache) |
|
37 | |||
38 | /** |
||
39 | * @param mixed $key |
||
40 | * @throws \Roave\DoctrineSimpleCache\Exception\InvalidArgumentException |
||
41 | */ |
||
42 | 30 | private function validateKey($key) : void |
|
56 | |||
57 | /** |
||
58 | * @param mixed $keys |
||
59 | * @return array |
||
60 | * @throws \Roave\DoctrineSimpleCache\Exception\InvalidArgumentException |
||
61 | */ |
||
62 | 25 | private function filterValidateMultipleKeys($keys) : array |
|
76 | |||
77 | /** |
||
78 | * {@inheritDoc} |
||
79 | */ |
||
80 | 2 | public function get($key, $default = null) |
|
91 | |||
92 | /** |
||
93 | * {@inheritDoc} |
||
94 | */ |
||
95 | 2 | public function set($key, $value, $ttl = null) : bool |
|
100 | |||
101 | /** |
||
102 | * {@inheritDoc} |
||
103 | */ |
||
104 | 3 | public function delete($key) : bool |
|
109 | |||
110 | /** |
||
111 | * {@inheritDoc} |
||
112 | */ |
||
113 | 1 | public function clear() : bool |
|
117 | |||
118 | /** |
||
119 | * @param array|\Traversable $keys |
||
120 | * @param mixed $default |
||
121 | * @return array |
||
122 | * @throws \Roave\DoctrineSimpleCache\Exception\InvalidArgumentException |
||
123 | */ |
||
124 | 23 | public function getMultiple($keys, $default = null) |
|
129 | |||
130 | /** |
||
131 | * @param array|\Traversable $values |
||
132 | * @param null|int|\DateInterval $ttl |
||
133 | * @return bool |
||
134 | * @throws \Roave\DoctrineSimpleCache\Exception\InvalidArgumentException |
||
135 | */ |
||
136 | 3 | public function setMultiple($values, $ttl = null) : bool |
|
148 | |||
149 | /** |
||
150 | * @param array|\Traversable $keys |
||
151 | * @return bool |
||
152 | * @throws \Roave\DoctrineSimpleCache\Exception\InvalidArgumentException |
||
153 | */ |
||
154 | 2 | public function deleteMultiple($keys) : bool |
|
167 | |||
168 | /** |
||
169 | * {@inheritDoc} |
||
170 | */ |
||
171 | 1 | public function has($key) : bool |
|
176 | } |
||
177 |
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: