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