Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
11 | public function create(ResponseInterface $response): ValidationResponseInterface |
||
12 | { |
||
13 | $jsonResponse = (string)$response->getBody(); |
||
14 | $jsonResponseObject = json_decode($jsonResponse); |
||
15 | |||
16 | $errorCollection = $jsonResponseObject->valid ? |
||
17 | new ErrorCollection() : |
||
18 | $this->createErrorCollectionFromJsonResponseObject($jsonResponseObject); |
||
19 | |||
20 | return new ValidationResponse( |
||
21 | $jsonResponseObject->source, |
||
22 | $jsonResponseObject->version, |
||
23 | $jsonResponseObject->valid, |
||
24 | $errorCollection |
||
25 | ); |
||
26 | } |
||
27 | |||
47 |