1 | <?php |
||
17 | class RedisDriver implements \Aviat\Ion\Cache\CacheDriverInterface { |
||
18 | |||
19 | /** |
||
20 | * The redis extension class instance |
||
21 | * #var Redis |
||
22 | */ |
||
23 | protected $redis; |
||
24 | |||
25 | /** |
||
26 | * Create the Redis cache driver |
||
27 | */ |
||
28 | public function __construct(ContainerInterface $container) |
||
53 | |||
54 | /** |
||
55 | * Destructor to disconnect from redis |
||
56 | */ |
||
57 | public function __destruct() |
||
61 | |||
62 | /** |
||
63 | * Retreive a value from the cache backend |
||
64 | * |
||
65 | * @param string $key |
||
66 | * @return mixed |
||
67 | */ |
||
68 | public function get($key) |
||
72 | |||
73 | /** |
||
74 | * Set a cached value |
||
75 | * |
||
76 | * @param string $key |
||
77 | * @param mixed $value |
||
78 | * @return CacheDriverInterface |
||
|
|||
79 | */ |
||
80 | public function set($key, $value) |
||
85 | |||
86 | /** |
||
87 | * Invalidate a cached value |
||
88 | * |
||
89 | * @param string $key |
||
90 | * @return CacheDriverInterface |
||
91 | */ |
||
92 | public function invalidate($key) |
||
97 | |||
98 | /** |
||
99 | * Clear the contents of the cache |
||
100 | * |
||
101 | * @return void |
||
102 | */ |
||
103 | public function invalidateAll() |
||
107 | } |
||
108 | // End of RedisDriver.php |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.