Conditions | 4 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
44 | private static function decodeSingleResult(SimpleXMLElement $element): SearchResponseCompanyData |
||
45 | { |
||
46 | $result = new SearchResponseCompanyData(); |
||
47 | |||
48 | foreach ($element as $key => $item) { |
||
49 | if ('ErrorCode' === $key && 4 === (int) $item) { |
||
50 | throw new NotFoundException('No data found'); |
||
51 | } |
||
52 | |||
53 | $result->$key = (string) $item; |
||
54 | } |
||
55 | |||
56 | return $result; |
||
57 | } |
||
59 |