function ResolveChildDefinitionsPass::processValue
Overrides AbstractRecursivePass::processValue
File
-
vendor/
symfony/ dependency-injection/ Compiler/ ResolveChildDefinitionsPass.php, line 34
Class
- ResolveChildDefinitionsPass
- This replaces all ChildDefinition instances with their equivalent fully merged Definition instance.
Namespace
Symfony\Component\DependencyInjection\CompilerCode
protected function processValue(mixed $value, bool $isRoot = false) : mixed {
if (!$value instanceof Definition) {
return parent::processValue($value, $isRoot);
}
if ($isRoot) {
// yes, we are specifically fetching the definition from the
// container to ensure we are not operating on stale data
$value = $this->container
->getDefinition($this->currentId);
}
if ($value instanceof ChildDefinition) {
$this->currentPath = [];
$value = $this->resolveDefinition($value);
if ($isRoot) {
$this->container
->setDefinition($this->currentId, $value);
}
}
return parent::processValue($value, $isRoot);
}