| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4.0218 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 14 | public function arrayToXml($array, \SimpleXMLElement $xml) |
|
| 29 | { |
||
| 30 | 14 | foreach ($array as $key => $value) { |
|
| 31 | 14 | if (is_array($value)) { |
|
| 32 | 14 | if (!is_numeric($key)) { |
|
| 33 | 14 | $this->arrayToXml($value, $xml->addChild("$key")); |
|
| 34 | 14 | } else { |
|
| 35 | $this->arrayToXml($value, $xml); |
||
| 36 | } |
||
| 37 | 14 | } else { |
|
| 38 | // Make sure that the request data is always escaped. |
||
| 39 | // See https://secure.php.net/manual/en/simplexmlelement.addchild.php#112204 |
||
| 40 | 14 | $xml->{$key} = $value; |
|
| 41 | } |
||
| 45 |