You are here

public static function XmlFileLoader::convertDomElementToArray in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Loader/XmlFileLoader.php \Symfony\Component\DependencyInjection\Loader\XmlFileLoader::convertDomElementToArray()

Converts a \DomElement object to a PHP array.

The following rules applies during the conversion:

  • Each tag is converted to a key value or an array if there is more than one "value"
  • The content of a tag is set under a "value" key (<foo>bar</foo>) if the tag also has some nested tags
  • The attributes are converted to keys (<foo foo="bar"/>)
  • The nested-tags are converted to keys (<foo><foo>bar</foo></foo>)

Parameters

\DomElement $element A \DomElement instance:

Return value

array A PHP array

2 calls to XmlFileLoader::convertDomElementToArray()
XmlFileLoader::loadFromExtensions in vendor/symfony/dependency-injection/Loader/XmlFileLoader.php
Loads from an extension.
XmlFileLoaderTest::testConvertDomElementToArray in vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php

File

vendor/symfony/dependency-injection/Loader/XmlFileLoader.php, line 564

Class

XmlFileLoader
XmlFileLoader loads XML files service definitions.

Namespace

Symfony\Component\DependencyInjection\Loader

Code

public static function convertDomElementToArray(\DomElement $element) {
  return XmlUtils::convertDomElementToArray($element);
}