Total Complexity | 6 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
12 | class DomainEventListener implements EventSubscriberInterface |
||
13 | { |
||
14 | private $publisher; |
||
15 | |||
16 | public function __construct(EventPublisher $publisher) |
||
19 | } |
||
20 | |||
21 | public static function getSubscribedEvents(): array |
||
22 | { |
||
23 | return [ |
||
24 | KernelEvents::RESPONSE => ['onKernelResponse', 1024], |
||
25 | KernelEvents::EXCEPTION => ['onKernelException', 1024], |
||
26 | ConsoleEvents::TERMINATE => ['onConsoleTerminate', 1024], |
||
27 | ConsoleEvents::ERROR => ['onConsoleError', 1024], |
||
28 | ]; |
||
29 | } |
||
30 | |||
31 | public function onKernelResponse(): void |
||
34 | } |
||
35 | |||
36 | public function onKernelException(): void |
||
37 | { |
||
38 | $this->publisher->discard(); |
||
39 | } |
||
40 | |||
41 | public function onConsoleTerminate(): void |
||
44 | } |
||
45 | |||
46 | public function onConsoleError(): void |
||
49 | } |
||
50 | } |
||
51 |