Conditions | 4 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
16 | 5 | public function onKernelException(GetResponseForExceptionEvent $event): void |
|
17 | { |
||
18 | 5 | if ($event->getResponse()) { |
|
19 | // Another listener already added a response, skip |
||
20 | 1 | return; |
|
21 | } |
||
22 | |||
23 | 4 | if (($request = $event->getRequest()) && $request instanceof Request) { |
|
24 | 3 | $response = $this->getResponse($request, $event->getException()); |
|
25 | 3 | $event->setResponse($response); |
|
26 | } |
||
45 |