Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2.0932 |
Changes | 4 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
12 | 3 | protected function transformXmlToArray($xmlString) |
|
13 | { |
||
14 | 3 | if (mb_detect_encoding($xmlString, 'UTF-8', true) === false) { |
|
15 | $xmlString = utf8_encode($xmlString); |
||
16 | } |
||
17 | |||
18 | 3 | $xml = simplexml_load_string($xmlString); |
|
19 | 3 | $json = json_encode($xml); |
|
20 | |||
21 | 3 | return json_decode($json, true); |
|
22 | } |
||
23 | } |
||
24 |