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\CompilerCode
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');
}
}
}