| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | 6 | public function onKernelView(GetResponseForControllerResultEvent $event) |
|
| 16 | { |
||
| 17 | 6 | $result = $event->getControllerResult(); |
|
| 18 | |||
| 19 | 6 | if (! $result instanceof RequestAcceptedResult) { |
|
| 20 | 2 | return; |
|
| 21 | } |
||
| 22 | |||
| 23 | 4 | $metadata = $result->getMetadata(); |
|
| 24 | 4 | $response = empty($metadata) ? new Response('', 202) : new JsonResponse($metadata, 202); |
|
| 25 | |||
| 26 | 4 | $event->setControllerResult($response); |
|
| 27 | 4 | } |
|
| 28 | |||
| 34 |