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

Breadcrumb

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

function ExtensionTrait::executeConfiguratorCallback

4 calls to ExtensionTrait::executeConfiguratorCallback()
AbstractExtension::load in vendor/symfony/dependency-injection/Extension/AbstractExtension.php
Loads a specific configuration.
AbstractExtension::prepend in vendor/symfony/dependency-injection/Extension/AbstractExtension.php
Allow an extension to prepend the extension configurations.
BundleExtension::load in vendor/symfony/http-kernel/Bundle/BundleExtension.php
Loads a specific configuration.
BundleExtension::prepend in vendor/symfony/http-kernel/Bundle/BundleExtension.php
Allow an extension to prepend the extension configurations.

File

vendor/symfony/dependency-injection/Extension/ExtensionTrait.php, line 33

Class

ExtensionTrait
@author Yonel Ceruto <yonelceruto@gmail.com>

Namespace

Symfony\Component\DependencyInjection\Extension

Code

private function executeConfiguratorCallback(ContainerBuilder $container, \Closure $callback, ConfigurableExtensionInterface $subject, bool $prepend = false) : void {
    $env = $container->getParameter('kernel.environment');
    $loader = $this->createContainerLoader($container, $env, $prepend);
    $file = (new \ReflectionObject($subject))->getFileName();
    $bundleLoader = $loader->getResolver()
        ->resolve($file);
    if (!$bundleLoader instanceof PhpFileLoader) {
        throw new \LogicException('Unable to create the ContainerConfigurator.');
    }
    $bundleLoader->setCurrentDir(\dirname($file));
    $instanceof =& \Closure::bind(fn&() => $this->instanceof, $bundleLoader, $bundleLoader)();
    try {
        $callback(new ContainerConfigurator($container, $bundleLoader, $instanceof, $file, $file, $env));
    } finally {
        $instanceof = [];
        $bundleLoader->registerAliasesForSinglyImplementedInterfaces();
    }
}

API Navigation

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