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

Breadcrumb

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

function ReplaceAliasByActualDefinitionPass::processValue

Overrides AbstractRecursivePass::processValue

File

vendor/symfony/dependency-injection/Compiler/ReplaceAliasByActualDefinitionPass.php, line 90

Class

ReplaceAliasByActualDefinitionPass
Replaces aliases with actual service definitions, effectively removing these aliases.

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

protected function processValue(mixed $value, bool $isRoot = false) : mixed {
    if ($value instanceof Reference && isset($this->replacements[$referenceId = (string) $value])) {
        // Perform the replacement
        $newId = $this->replacements[$referenceId];
        $value = new Reference($newId, $value->getInvalidBehavior());
        $this->container
            ->log($this, \sprintf('Changed reference of service "%s" previously pointing to "%s" to "%s".', $this->currentId, $referenceId, $newId));
    }
    return parent::processValue($value, $isRoot);
}
RSS feed
Powered by Drupal