1 | <?php |
||
12 | class PredisAdapter implements CacheAdapterInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var ClientInterface |
||
16 | */ |
||
17 | private $client; |
||
18 | /** |
||
19 | * @var SerializerInterface |
||
20 | */ |
||
21 | private $serializer; |
||
22 | /** |
||
23 | * @var int|null |
||
24 | */ |
||
25 | private $ttl; |
||
26 | |||
27 | /** |
||
28 | * @param ClientInterface $client |
||
29 | * @param SerializerInterface $serializer |
||
30 | * @param null $ttl |
||
31 | */ |
||
32 | 6 | public function __construct( |
|
41 | |||
42 | |||
43 | /** |
||
44 | * Gets a cache entry |
||
45 | * returning null if not in cache |
||
46 | * |
||
47 | * @param $key |
||
48 | * @return null|mixed |
||
49 | */ |
||
50 | 2 | public function get($key) |
|
54 | |||
55 | /** |
||
56 | * Sets a cache entry |
||
57 | * |
||
58 | * @param $key |
||
59 | * @param $value |
||
60 | * @return void |
||
61 | */ |
||
62 | 5 | public function set($key, $value) |
|
70 | |||
71 | /** |
||
72 | * Deletes a cache entry |
||
73 | * |
||
74 | * @param $key |
||
75 | * @return void |
||
76 | */ |
||
77 | 3 | public function delete($key) |
|
85 | |||
86 | 2 | private function deleteGlob ($pattern) { |
|
103 | } |
||
104 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: