Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. XmlFileLoader.php

function XmlFileLoader::getServiceDefaults

1 call to XmlFileLoader::getServiceDefaults()
XmlFileLoader::loadXml in vendor/symfony/dependency-injection/Loader/XmlFileLoader.php

File

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

Class

XmlFileLoader
XmlFileLoader loads XML files service definitions.

Namespace

Symfony\Component\DependencyInjection\Loader

Code

private function getServiceDefaults(\DOMDocument $xml, string $file, ?\DOMNode $root = null) : Definition {
    $xpath = new \DOMXPath($xml);
    $xpath->registerNamespace('container', self::NS);
    if (null === ($defaultsNode = $xpath->query('./container:services/container:defaults', $root)
        ->item(0))) {
        return new Definition();
    }
    $defaultsNode->setAttribute('id', '<defaults>');
    return $this->parseDefinition($defaultsNode, $file, new Definition());
}
RSS feed
Powered by Drupal