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 | 6 | public function create(ResponseInterface $response): ValidationResponseInterface |
|
12 | { |
||
13 | 6 | $jsonResponse = (string)$response->getBody(); |
|
14 | 6 | $jsonResponseObject = json_decode($jsonResponse); |
|
15 | |||
16 | 6 | $errorCollection = $jsonResponseObject->valid ? |
|
17 | 3 | new ErrorCollection() : |
|
18 | 6 | $this->createErrorCollectionFromJsonResponseObject($jsonResponseObject); |
|
19 | |||
20 | 6 | return new ValidationResponse( |
|
21 | 6 | $jsonResponseObject->source, |
|
22 | 6 | $jsonResponseObject->version, |
|
23 | 6 | $jsonResponseObject->valid, |
|
24 | 6 | $errorCollection |
|
25 | ); |
||
26 | } |
||
27 | |||
47 |