Total Complexity | 4 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
19 | class CacheEventListener implements CacheEventListenerInterface |
||
20 | { |
||
21 | private $logger; |
||
22 | |||
23 | public function __construct($logger) |
||
24 | { |
||
25 | $this->logger = $logger; |
||
26 | } |
||
27 | |||
28 | public function onDelete($key, $entry) |
||
29 | { |
||
30 | $logEntry = new LogEntry( |
||
31 | new DateTimeImmutable(date('Y-m-d H:i:s'), new DateTimeZone('UTC')), |
||
32 | LogEntry::SEVERITY_INFO, |
||
33 | 'Cache Entry with key '.$key.' deleted' |
||
34 | ); |
||
35 | |||
36 | $this->logger->log($logEntry); |
||
37 | |||
38 | return $entry; |
||
39 | } |
||
40 | |||
41 | public function onGet($key, $entry) |
||
52 | } |
||
53 | |||
54 | public function onSet($key, $entry) |
||
67 |