You are here

private function YamlFileLoader::parseImports in Zircon Profile 8

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

Parses all imports.

Parameters

array $content:

string $file:

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

File

vendor/symfony/dependency-injection/Loader/YamlFileLoader.php, line 88

Class

YamlFileLoader
YamlFileLoader loads YAML files service definitions.

Namespace

Symfony\Component\DependencyInjection\Loader

Code

private function parseImports($content, $file) {
  if (!isset($content['imports'])) {
    return;
  }
  if (!is_array($content['imports'])) {
    throw new InvalidArgumentException(sprintf('The "imports" key should contain an array in %s. Check your YAML syntax.', $file));
  }
  foreach ($content['imports'] as $import) {
    if (!is_array($import)) {
      throw new InvalidArgumentException(sprintf('The values in the "imports" key should be arrays in %s. Check your YAML syntax.', $file));
    }
    $this
      ->setCurrentDir(dirname($file));
    $this
      ->import($import['resource'], null, isset($import['ignore_errors']) ? (bool) $import['ignore_errors'] : false, $file);
  }
}