src/Config/Writer/Xml.php
private function addChildNode(string $name, array $config, \XMLWriter $writer): void
    {
        $writer->startElement($name);

        foreach ($config as $nodeName => $nodeData) {
            $nodeName = \is_numeric($nodeName) ? 'num__'.$nodeName : $nodeName;

            if (\is_array($nodeData)) {
                $this->addChildNode($nodeName, $nodeData, $writer);
            } elseif (\is_bool($nodeData)) {
                $writer->writeElement($nodeName, $nodeData === true ? 'true' : 'false');
            } else {
                $writer->writeElement($nodeName, (string)$nodeData);
            }
        }

        $writer->endElement();
    }
private function addChildNode(string $name, array $config, \XMLWriter $writer): void
    {
        $writer->startElement($name);

        foreach ($config as $nodeName => $nodeData) {
            $nodeName = \is_numeric($nodeName) ? 'num__'.$nodeName : $nodeName;

            if (\is_array($nodeData)) {
                $this->addChildNode($nodeName, $nodeData, $writer);
            } elseif (\is_bool($nodeData)) {
                $writer->writeElement($nodeName, $nodeData === true ? 'true' : 'false');
            } else {
                $writer->writeElement($nodeName, (string)$nodeData);
            }
        }

        $writer->endElement();
    }
private function addChildNode ( string $ name , array $ config , \ XMLWriter $ writer ) : void { $ writer -> startElement ( $ name ) ; foreach ( $ config as $ nodeName => $ nodeData ) { $ nodeName = \ is_numeric ( $ nodeName ) ? 'num__' . $ nodeName : $ nodeName ; if ( \ is_array ( $ nodeData ) ) { $ this -> addChildNode ( $ nodeName , $ nodeData , $ writer ) ; } elseif ( \ is_bool ( $ nodeData ) ) { $ writer -> writeElement ( $ nodeName , $ nodeData === true ? 'true' : 'false' ) ; } else { $ writer -> writeElement ( $ nodeName , ( string ) $ nodeData ) ; } } $ writer -> endElement ( ) ; }
Adds new child node to configuration XML

@param string     $name
@param array      $config
@param \XMLWriter $writer
Adds new child node to configuration XML