Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function createFromResponse(DataResponse $response): ApiResponse |
||
13 | { |
||
14 | if ($response->getStatusCode() !== Status::OK) { |
||
15 | return $this |
||
16 | ->createErrorResponse() |
||
17 | ->setErrorCode($response->getStatusCode()) |
||
18 | ->setErrorMessage($this->getErrorMessage($response)); |
||
19 | } |
||
20 | |||
21 | return $this |
||
22 | ->createSuccessResponse() |
||
23 | ->setData($response->getData()); |
||
|
|||
24 | } |
||
55 |