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

Breadcrumb

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

function ResolveNoPreloadPass::process

Overrides AbstractRecursivePass::process

File

vendor/symfony/dependency-injection/Compiler/ResolveNoPreloadPass.php, line 31

Class

ResolveNoPreloadPass
Propagate the "container.no_preload" tag.

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

public function process(ContainerBuilder $container) : void {
    $this->container = $container;
    try {
        foreach ($container->getDefinitions() as $id => $definition) {
            if ($definition->isPublic() && !$definition->isPrivate() && !isset($this->resolvedIds[$id])) {
                $this->resolvedIds[$id] = true;
                $this->processValue($definition, true);
            }
        }
        foreach ($container->getAliases() as $alias) {
            if ($alias->isPublic() && !$alias->isPrivate() && !isset($this->resolvedIds[$id = (string) $alias]) && $container->hasDefinition($id)) {
                $this->resolvedIds[$id] = true;
                $this->processValue($container->getDefinition($id), true);
            }
        }
    } finally {
        $this->resolvedIds = [];
        $this->container = null;
    }
    foreach ($container->getDefinitions() as $definition) {
        if ($definition->hasTag(self::DO_PRELOAD_TAG)) {
            $definition->clearTag(self::DO_PRELOAD_TAG);
        }
        elseif (!$definition->isDeprecated() && !$definition->hasErrors()) {
            $definition->addTag('container.no_preload');
        }
    }
}
RSS feed
Powered by Drupal