Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
29 | public function __invoke( |
||
30 | ResponseInterface $response, |
||
31 | ElementInterface $element, |
||
32 | ObjectsFieldInterface $field |
||
33 | ): ElementInterface { |
||
34 | /** @var Element $element */ |
||
35 | |||
36 | $data = Json::decodeIfJson( |
||
37 | $response->getBody()->getContents() |
||
38 | ); |
||
39 | |||
40 | $errors = call_user_func_array( |
||
41 | new InterpretResponseErrors(), |
||
42 | [ |
||
43 | $data |
||
44 | ] |
||
45 | ); |
||
46 | |||
47 | $element->addErrors($errors); |
||
48 | |||
49 | return $element; |
||
50 | } |
||
51 | } |
||
52 |