| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 51 | protected function writeXml(array $rows, array $lines = []) |
||
| 52 | { |
||
| 53 | foreach ($rows as $key => $value) { |
||
| 54 | if (\is_array($value)) { |
||
| 55 | if (\is_numeric($key)) { |
||
| 56 | $key = 'item'; |
||
| 57 | } |
||
| 58 | $lines[] = sprintf("<%s>\n%s\n</%s>", $key, $this->writeXml($value), $key); |
||
| 59 | } else { |
||
| 60 | $lines[] = sprintf('<%s>%s</%s>', $key, $value, $key); |
||
| 61 | } |
||
| 62 | } |
||
| 63 | |||
| 64 | return implode(PHP_EOL, $lines); |
||
| 65 | } |
||
| 66 | } |
||
| 67 |