| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php // Copyright ⓒ 2018 Magneds IP B.V. - All Rights Reserved |
||
| 54 | public function handleResponse(ResponseInterface $response): ResponseInfo |
||
| 55 | { |
||
| 56 | $responseData = json_decode($response->getBody()->getContents(), true); |
||
| 57 | $responseInfo = ResponseInfo::buildFromArray($responseData['response']); |
||
| 58 | |||
| 59 | if ($responseInfo->getCode() !== 200) { |
||
| 60 | return $responseInfo; |
||
| 61 | } |
||
| 62 | |||
| 63 | $projects = []; |
||
| 64 | foreach ($responseData['projects'] as $project) { |
||
| 65 | $projects[] = Project::buildFromArray($project); |
||
| 66 | } |
||
| 67 | |||
| 68 | // Add it to the response object. |
||
| 69 | $responseInfo->setActionData($projects); |
||
| 70 | |||
| 71 | return $responseInfo; |
||
| 72 | } |
||
| 74 |