1 | <?php |
||
18 | class LoggerCache implements Cache, CacheDecorator |
||
19 | { |
||
20 | use CacheDecoratorTrait, LoggerCacheTrait; |
||
21 | |||
22 | /** |
||
23 | * @var bool |
||
24 | */ |
||
25 | private $withExceptions; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $logLevel; |
||
31 | |||
32 | /** |
||
33 | * SilentCacheDecorator constructor. |
||
34 | * |
||
35 | * @param Cache $cache |
||
36 | * @param bool $withExceptions |
||
37 | * @param LoggerInterface $logger |
||
38 | * @param string $logLevel |
||
39 | */ |
||
40 | 1 | public function __construct( |
|
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | 1 | public function set($key, $value, $timeToLive = null) |
|
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | 1 | public function has($key) |
|
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | 1 | public function get($key, $default = null) |
|
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | 1 | public function demand($key) |
|
107 | |||
108 | /** |
||
109 | * {@inheritdoc} |
||
110 | */ |
||
111 | 1 | public function delete($key) |
|
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | 1 | public function flush() |
|
134 | |||
135 | /** |
||
136 | * {@inheritdoc} |
||
137 | */ |
||
138 | 1 | public function setItems(array $items, $timeToLive = null) |
|
148 | |||
149 | /** |
||
150 | * {@inheritdoc} |
||
151 | */ |
||
152 | 1 | public function getItems(array $keys) |
|
162 | |||
163 | /** |
||
164 | * {@inheritdoc} |
||
165 | */ |
||
166 | public function deleteItems(array $keys) |
||
176 | |||
177 | /** |
||
178 | * Gets the remaining time to live for an item |
||
179 | * |
||
180 | * @param $key |
||
181 | * |
||
182 | * @return int|null |
||
183 | */ |
||
184 | 1 | public function getTimeToLive($key) |
|
193 | |||
194 | /** |
||
195 | * @param callable $callable |
||
196 | * |
||
197 | * @param string $method |
||
198 | * @param array $arguments |
||
199 | * |
||
200 | * @return mixed |
||
201 | * @throws BackendOperationFailedException |
||
202 | * @throws CacheException |
||
203 | */ |
||
204 | 1 | protected function call(callable $callable, $method, $arguments = []) |
|
221 | |||
222 | /** |
||
223 | * @param Exception $exception |
||
224 | * @param string $method |
||
225 | * @param array $arguments |
||
226 | * |
||
227 | * @return bool |
||
228 | */ |
||
229 | 1 | protected function logException(Exception $exception, $method, array $arguments) |
|
239 | } |
||
240 |