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