Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public static function parseXml($xml) |
||
19 | { |
||
20 | libxml_use_internal_errors(true); |
||
21 | $data = simplexml_load_string($xml, null, LIBXML_NOERROR); |
||
22 | if ($data === false) { |
||
23 | throw new InvalidArgumentException(sprintf('Invalid xml response "%s"', $xml)); |
||
24 | } |
||
25 | return json_decode(json_encode($data), true); |
||
26 | } |
||
27 | } |