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\Exception\CacheException |
||
22 | */ |
||
23 | 14 | public function __construct(DoctrineCache $doctrineCache) |
|
37 | |||
38 | /** |
||
39 | * {@inheritDoc} |
||
40 | */ |
||
41 | 2 | public function get($key, $default = null) |
|
50 | |||
51 | /** |
||
52 | * {@inheritDoc} |
||
53 | */ |
||
54 | 2 | public function set($key, $value, $ttl = null) : bool |
|
74 | |||
75 | /** |
||
76 | * {@inheritDoc} |
||
77 | */ |
||
78 | 3 | public function delete($key) : bool |
|
82 | |||
83 | /** |
||
84 | * {@inheritDoc} |
||
85 | */ |
||
86 | 1 | public function clear() : bool |
|
90 | |||
91 | /** |
||
92 | * {@inheritDoc} |
||
93 | */ |
||
94 | 2 | public function getMultiple($keys, $default = null) |
|
98 | |||
99 | /** |
||
100 | * {@inheritDoc} |
||
101 | */ |
||
102 | 2 | public function setMultiple($values, $ttl = null) : bool |
|
122 | |||
123 | /** |
||
124 | * {@inheritDoc} |
||
125 | */ |
||
126 | 2 | public function deleteMultiple($keys) : bool |
|
138 | |||
139 | /** |
||
140 | * {@inheritDoc} |
||
141 | */ |
||
142 | 1 | public function has($key) : bool |
|
146 | |||
147 | private static function convertDateIntervalToInteger(\DateInterval $ttl) : int |
||
155 | } |
||
156 |
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: