You are here

private function PhpDumper::getServiceCallsFromArguments in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php \Symfony\Component\DependencyInjection\Dumper\PhpDumper::getServiceCallsFromArguments()

Builds service calls from arguments.

Parameters

array $arguments:

array &$calls By reference:

array &$behavior By reference:

1 call to PhpDumper::getServiceCallsFromArguments()
PhpDumper::addServiceLocalTempVariables in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
Generates Service local temp variables.

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php, line 1158

Class

PhpDumper
PhpDumper dumps a service container as a PHP class.

Namespace

Symfony\Component\DependencyInjection\Dumper

Code

private function getServiceCallsFromArguments(array $arguments, array &$calls, array &$behavior) {
  foreach ($arguments as $argument) {
    if (is_array($argument)) {
      $this
        ->getServiceCallsFromArguments($argument, $calls, $behavior);
    }
    elseif ($argument instanceof Reference) {
      $id = (string) $argument;
      if (!isset($calls[$id])) {
        $calls[$id] = 0;
      }
      if (!isset($behavior[$id])) {
        $behavior[$id] = $argument
          ->getInvalidBehavior();
      }
      elseif (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $behavior[$id]) {
        $behavior[$id] = $argument
          ->getInvalidBehavior();
      }
      ++$calls[$id];
    }
  }
}