You are here

private function ReplaceAliasByActualDefinitionPass::updateArgumentReferences in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Compiler/ReplaceAliasByActualDefinitionPass.php \Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass::updateArgumentReferences()

Updates argument references.

Parameters

array $arguments An array of Arguments:

string $currentId The alias identifier:

string $newId The identifier the alias points to:

Return value

array

1 call to ReplaceAliasByActualDefinitionPass::updateArgumentReferences()
ReplaceAliasByActualDefinitionPass::updateReferences in vendor/symfony/dependency-injection/Compiler/ReplaceAliasByActualDefinitionPass.php
Updates references to remove aliases.

File

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

Class

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

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

private function updateArgumentReferences(array $arguments, $currentId, $newId) {
  foreach ($arguments as $k => $argument) {
    if (is_array($argument)) {
      $arguments[$k] = $this
        ->updateArgumentReferences($argument, $currentId, $newId);
    }
    elseif ($argument instanceof Reference) {
      if ($currentId === (string) $argument) {
        $arguments[$k] = new Reference($newId, $argument
          ->getInvalidBehavior());
        $this->compiler
          ->addLogMessage($this->formatter
          ->formatUpdateReference($this, $this->sourceId, $currentId, $newId));
      }
    }
  }
  return $arguments;
}