Gets a service call
string $id:
Reference $reference:
string
private function getServiceCall($id, Reference $reference = null) {
if ('service_container' === $id) {
return '$this';
}
if (null !== $reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $reference
->getInvalidBehavior()) {
return sprintf('$this->get(\'%s\', ContainerInterface::NULL_ON_INVALID_REFERENCE)', $id);
}
else {
if ($this->container
->hasAlias($id)) {
$id = (string) $this->container
->getAlias($id);
}
return sprintf('$this->get(\'%s\')', $id);
}
}