You are here

private function XmlFileLoader::parseDefinitions in Zircon Profile 8.0

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

Parses multiple definitions.

Parameters

\DOMDocument $xml:

string $file:

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

File

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

Class

XmlFileLoader
XmlFileLoader loads XML files service definitions.

Namespace

Symfony\Component\DependencyInjection\Loader

Code

private function parseDefinitions(\DOMDocument $xml, $file) {
  $xpath = new \DOMXPath($xml);
  $xpath
    ->registerNamespace('container', self::NS);
  if (false === ($services = $xpath
    ->query('//container:services/container:service'))) {
    return;
  }
  foreach ($services as $service) {
    if (null !== ($definition = $this
      ->parseDefinition($service, $file))) {
      $this->container
        ->setDefinition((string) $service
        ->getAttribute('id'), $definition);
    }
  }
}