You are here

private function YamlFileLoader::parseDefinitions in Service Container 7

Same name in this branch
  1. 7 lib/Drupal/Core/DependencyInjection/YamlFileLoader.php \Drupal\Core\DependencyInjection\YamlFileLoader::parseDefinitions()
  2. 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php \Symfony\Component\DependencyInjection\Loader\YamlFileLoader::parseDefinitions()
Same name and namespace in other branches
  1. 7.2 lib/Drupal/Core/DependencyInjection/YamlFileLoader.php \Drupal\Core\DependencyInjection\YamlFileLoader::parseDefinitions()

Parses definitions

Parameters

array $content:

string $file:

1 call to YamlFileLoader::parseDefinitions()
YamlFileLoader::load in lib/Drupal/Core/DependencyInjection/YamlFileLoader.php
Loads a Yaml file.

File

lib/Drupal/Core/DependencyInjection/YamlFileLoader.php, line 109
Contains \Drupal\Core\DependencyInjection\YamlFileLoader.

Class

YamlFileLoader
YamlFileLoader loads YAML files service definitions.

Namespace

Drupal\Core\DependencyInjection

Code

private function parseDefinitions($content, $file) {
  if (!isset($content['services'])) {
    return;
  }
  if (!is_array($content['services'])) {
    throw new InvalidArgumentException(sprintf('The "services" key should contain an array in %s. Check your YAML syntax.', $file));
  }
  foreach ($content['services'] as $id => $service) {
    $this
      ->parseDefinition($id, $service, $file);
  }
}