private function PhpDumper::addServiceMethodCalls in Service Container 7.2
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/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 modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Dumper/ PhpDumper.php - Adds a service.
- PhpDumper::addServiceInlinedDefinitions in modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Dumper/ PhpDumper.php - Generates the inline definition of a service.
- PhpDumper::addServiceInlinedDefinitionsSetup in modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Dumper/ PhpDumper.php - Generates the inline definition setup.
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Dumper/ PhpDumper.php, line 441
Class
- PhpDumper
- PhpDumper dumps a service container as a PHP class.
Namespace
Symfony\Component\DependencyInjection\DumperCode
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;
}