You are here

private function PhpDumper::addServiceMethodCalls in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/dependency-injection/Dumper/PhpDumper.php \Symfony\Component\DependencyInjection\Dumper\PhpDumper::addServiceMethodCalls()

Adds method calls to a service definition.

Parameters

string $id:

Definition $definition:

string $variableName:

Return value

string

3 calls to PhpDumper::addServiceMethodCalls()
PhpDumper::addService in vendor/symfony/dependency-injection/Dumper/PhpDumper.php
Adds a service.
PhpDumper::addServiceInlinedDefinitions in vendor/symfony/dependency-injection/Dumper/PhpDumper.php
Generates the inline definition of a service.
PhpDumper::addServiceInlinedDefinitionsSetup in vendor/symfony/dependency-injection/Dumper/PhpDumper.php
Generates the inline definition setup.

File

vendor/symfony/dependency-injection/Dumper/PhpDumper.php, line 441

Class

PhpDumper
PhpDumper dumps a service container as a PHP class.

Namespace

Symfony\Component\DependencyInjection\Dumper

Code

private function addServiceMethodCalls($id, $definition, $variableName = 'instance') {
  $calls = '';
  foreach ($definition
    ->getMethodCalls() as $call) {
    $arguments = array();
    foreach ($call[1] as $value) {
      $arguments[] = $this
        ->dumpValue($value);
    }
    $calls .= $this
      ->wrapServiceConditionals($call[1], sprintf("        \$%s->%s(%s);\n", $variableName, $call[0], implode(', ', $arguments)));
  }
  return $calls;
}