private function 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 drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
Generates Service local temp variables.

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php, line 1026

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] += 1;
    }
  }
}