Conditions | 4 |
Paths | 6 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
58 | 9 | protected function toXML(array $arr, $rootElement = '<config/>', $xml = null) |
|
59 | { |
||
60 | 9 | if ($xml === null) { |
|
61 | 9 | $xml = new SimpleXMLElement($rootElement); |
|
62 | } |
||
63 | 9 | foreach ($arr as $k => $v) { |
|
64 | 9 | if (is_array($v)) { |
|
65 | 9 | $this->toXML($v, $k, $xml->addChild($k)); |
|
66 | } else { |
||
67 | 9 | $xml->addChild($k, $v); |
|
68 | } |
||
69 | } |
||
70 | |||
71 | 9 | return $xml->asXML(); |
|
72 | } |
||
73 | } |
||
74 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.