Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | public function handle($xml) |
||
14 | { |
||
15 | $response = new stdClass; |
||
16 | |||
17 | foreach ($xml->children() as $child) { |
||
18 | |||
19 | $name = $child->getName(); |
||
20 | |||
21 | if (in_array($name, self::STRINGS)) { |
||
22 | $response->$name = (string) $child; |
||
23 | } else { |
||
24 | $response->$name[] = $this->processChild($name, $child); |
||
25 | } |
||
26 | } |
||
27 | |||
28 | return json_encode($response); |
||
29 | } |
||
30 | |||
40 |