Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
26 | 44 | public function createResponse(AbstractApiResponse $apiResponse): Response |
|
27 | { |
||
28 | 44 | $serializedData = $this->serialize($apiResponse); |
|
29 | |||
30 | 44 | if ($apiResponse instanceof FileResponse) { |
|
31 | 1 | $response = new BinaryFileResponse($apiResponse->getFile(), $apiResponse->getHttpCode()); |
|
32 | } else { |
||
33 | 44 | $response = new Response($serializedData, $apiResponse->getHttpCode()); |
|
34 | } |
||
35 | |||
36 | 44 | return $response; |
|
37 | } |
||
38 | |||
48 |