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

Breadcrumb

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

function YamlFileLoader::loadContent

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

File

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

Class

YamlFileLoader
YamlFileLoader loads YAML files service definitions.

Namespace

Symfony\Component\DependencyInjection\Loader

Code

private function loadContent(array $content, string $path) : void {
    // imports
    $this->parseImports($content, $path);
    // parameters
    if (isset($content['parameters'])) {
        if (!\is_array($content['parameters'])) {
            throw new InvalidArgumentException(\sprintf('The "parameters" key should contain an array in "%s". Check your YAML syntax.', $path));
        }
        foreach ($content['parameters'] as $key => $value) {
            $this->container
                ->setParameter($key, $this->resolveServices($value, $path, true));
        }
    }
    // extensions
    $this->loadFromExtensions($content);
    // services
    $this->anonymousServicesCount = 0;
    $this->anonymousServicesSuffix = '~' . ContainerBuilder::hash($path);
    $this->setCurrentDir(\dirname($path));
    try {
        $this->parseDefinitions($content, $path);
    } finally {
        $this->instanceof = [];
        $this->registerAliasesForSinglyImplementedInterfaces();
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal