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