Conditions | 4 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 2 | Features | 0 |
1 | <?php |
||
29 | public function __construct($body, $format) |
||
30 | { |
||
31 | switch ($format) { |
||
32 | case 'xml': |
||
33 | libxml_use_internal_errors(true); |
||
34 | $res = simplexml_load_string((string) $body); |
||
35 | if ($res) { |
||
36 | $res = json_decode(json_encode($res)); |
||
37 | } |
||
38 | break; |
||
39 | case 'json': |
||
40 | $res = json_decode((string) $body); |
||
41 | break; |
||
42 | default: |
||
43 | $res = (string) $body; |
||
44 | break; |
||
45 | } |
||
46 | $this->parseResponseBody($res); |
||
47 | } |
||
68 |