function AbstractRecursivePass::processValue
Processes a value found in a definition tree.
Return value
mixed
62 calls to AbstractRecursivePass::processValue()
- AbstractRecursivePass::getExpressionLanguage in vendor/
symfony/ dependency-injection/ Compiler/ AbstractRecursivePass.php - AbstractRecursivePass::process in vendor/
symfony/ dependency-injection/ Compiler/ AbstractRecursivePass.php - AliasDeprecatedPublicServicesPass::processValue in vendor/
symfony/ dependency-injection/ Compiler/ AliasDeprecatedPublicServicesPass.php - Processes a value found in a definition tree.
- AliasDeprecatedPublicServicesPass::processValue in vendor/
symfony/ dependency-injection/ Compiler/ AliasDeprecatedPublicServicesPass.php - Processes a value found in a definition tree.
- AnalyzeServiceReferencesPass::processValue in vendor/
symfony/ dependency-injection/ Compiler/ AnalyzeServiceReferencesPass.php - Processes a value found in a definition tree.
29 methods override AbstractRecursivePass::processValue()
- AliasDeprecatedPublicServicesPass::processValue in vendor/
symfony/ dependency-injection/ Compiler/ AliasDeprecatedPublicServicesPass.php - Processes a value found in a definition tree.
- AnalyzeServiceReferencesPass::processValue in vendor/
symfony/ dependency-injection/ Compiler/ AnalyzeServiceReferencesPass.php - Processes a value found in a definition tree.
- AttributeAutoconfigurationPass::processValue in vendor/
symfony/ dependency-injection/ Compiler/ AttributeAutoconfigurationPass.php - Processes a value found in a definition tree.
- AutowirePass::processValue in vendor/
symfony/ dependency-injection/ Compiler/ AutowirePass.php - Processes a value found in a definition tree.
- AutowireRequiredMethodsPass::processValue in vendor/
symfony/ dependency-injection/ Compiler/ AutowireRequiredMethodsPass.php - Processes a value found in a definition tree.
File
-
vendor/
symfony/ dependency-injection/ Compiler/ AbstractRecursivePass.php, line 71
Class
- AbstractRecursivePass
- @author Nicolas Grekas <p@tchwork.com>
Namespace
Symfony\Component\DependencyInjection\CompilerCode
protected function processValue(mixed $value, bool $isRoot = false) {
if (\is_array($value)) {
foreach ($value as $k => $v) {
if ((!$v || \is_scalar($v)) && $this->skipScalars) {
continue;
}
if ($isRoot) {
if ($v instanceof Definition && $v->hasTag('container.excluded')) {
continue;
}
$this->currentId = $k;
}
if ($v !== ($processedValue = $this->processValue($v, $isRoot))) {
$value[$k] = $processedValue;
}
}
}
elseif ($value instanceof ArgumentInterface) {
$value->setValues($this->processValue($value->getValues()));
}
elseif ($value instanceof Expression && $this->processExpressions) {
$this->getExpressionLanguage()
->compile((string) $value, [
'this' => 'container',
'args' => 'args',
]);
}
elseif ($value instanceof Definition) {
$value->setArguments($this->processValue($value->getArguments()));
$value->setProperties($this->processValue($value->getProperties()));
$value->setMethodCalls($this->processValue($value->getMethodCalls()));
$changes = $value->getChanges();
if (isset($changes['factory'])) {
if (\is_string($factory = $value->getFactory()) && str_starts_with($factory, '@=')) {
if (!class_exists(Expression::class)) {
throw new LogicException('Expressions cannot be used in service factories without the ExpressionLanguage component. Try running "composer require symfony/expression-language".');
}
$factory = new Expression(substr($factory, 2));
}
if (($factory = $this->processValue($factory)) instanceof Expression) {
$factory = '@=' . $factory;
}
$value->setFactory($factory);
}
if (isset($changes['configurator'])) {
$value->setConfigurator($this->processValue($value->getConfigurator()));
}
}
return $value;
}