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