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

Breadcrumb

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

function ContainerConfigurator::extension

File

vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php, line 48

Class

ContainerConfigurator
@author Nicolas Grekas <p@tchwork.com>

Namespace

Symfony\Component\DependencyInjection\Loader\Configurator

Code

public final function extension(string $namespace, array $config, bool $prepend = false) : void {
    if ($prepend) {
        $this->container
            ->prependExtensionConfig($namespace, static::processValue($config));
        return;
    }
    if (!$this->container
        ->hasExtension($namespace)) {
        $extensions = array_filter(array_map(fn(ExtensionInterface $ext) => $ext->getAlias(), $this->container
            ->getExtensions()));
        throw new InvalidArgumentException(UndefinedExtensionHandler::getErrorMessage($namespace, $this->file, $namespace, $extensions));
    }
    $this->container
        ->loadFromExtension($namespace, static::processValue($config));
}
RSS feed
Powered by Drupal