src/lib/eZ/RichText/Converter/Render.php
protected function extractHash(DOMNode $configHash)
    {
        $hash = [];

        foreach ($configHash->childNodes as $node) {
            /** @var \DOMText|\DOMElement $node */
            if ($node->nodeType === XML_ELEMENT_NODE) {
                $hash[$node->getAttribute('key')] = $this->extractHash($node);
            } elseif ($node->nodeType === XML_TEXT_NODE && !$node->isWhitespaceInElementContent()) {
                return $node->wholeText;
            }
        }

        return $hash;
    }
protected function extractHash(DOMNode $configHash)
    {
        $hash = [];

        foreach ($configHash->childNodes as $node) {
            /** @var \DOMText|\DOMElement $node */
            if ($node->nodeType === XML_ELEMENT_NODE) {
                $hash[$node->getAttribute('key')] = $this->extractHash($node);
            } elseif ($node->nodeType === XML_TEXT_NODE && !$node->isWhitespaceInElementContent()) {
                return $node->wholeText;
            }
        }

        return $hash;
    }
protected function extractHash ( DOMNode $ configHash ) { $ hash = [ ] ; foreach ( $ configHash -> childNodes as $ node ) { /** @var \DOMText|\DOMElement $node */ if ( $ node -> nodeType === XML_ELEMENT_NODE ) { $ hash [ $ node -> getAttribute ( 'key' ) ] = $ this -> extractHash ( $ node ) ; } elseif ( $ node -> nodeType === XML_TEXT_NODE && ! $ node -> isWhitespaceInElementContent ( ) ) { return $ node -> wholeText ; } } return $ hash ; }
Recursively extracts data from XML hash structure.

@param \DOMNode $configHash

@return array
Recursively extracts data from XML hash structure .