You are here

private function AnalyzeServiceReferencesPass::processArguments in Zircon Profile 8

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

Processes service definitions for arguments to find relationships for the service graph.

Parameters

array $arguments An array of Reference or Definition objects relating to service definitions:

1 call to AnalyzeServiceReferencesPass::processArguments()
AnalyzeServiceReferencesPass::process in vendor/symfony/dependency-injection/Compiler/AnalyzeServiceReferencesPass.php
Processes a ContainerBuilder object to populate the service reference graph.

File

vendor/symfony/dependency-injection/Compiler/AnalyzeServiceReferencesPass.php, line 100

Class

AnalyzeServiceReferencesPass
Run this pass before passes that need to know more about the relation of your services.

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

private function processArguments(array $arguments) {
  foreach ($arguments as $argument) {
    if (is_array($argument)) {
      $this
        ->processArguments($argument);
    }
    elseif ($argument instanceof Reference) {
      $this->graph
        ->connect($this->currentId, $this->currentDefinition, $this
        ->getDefinitionId((string) $argument), $this
        ->getDefinition((string) $argument), $argument);
    }
    elseif ($argument instanceof Definition) {
      $this
        ->processArguments($argument
        ->getArguments());
      $this
        ->processArguments($argument
        ->getMethodCalls());
      $this
        ->processArguments($argument
        ->getProperties());
      if (is_array($argument
        ->getFactory())) {
        $this
          ->processArguments($argument
          ->getFactory());
      }
      if ($argument
        ->getFactoryService(false)) {
        $this
          ->processArguments(array(
          new Reference($argument
            ->getFactoryService(false)),
        ));
      }
    }
  }
}