private function PhpDumper::getServiceCall

Gets a service call

Parameters

string $id:

Reference $reference:

Return value

string

5 calls to PhpDumper::getServiceCall()
PhpDumper::addServiceConfigurator in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
Adds configurator definition
PhpDumper::addServiceInlinedDefinitions in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
Generates the inline definition of a service.
PhpDumper::addServiceInstance in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
Generates the service instance.
PhpDumper::addServiceLocalTempVariables in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
Generates Service local temp variables.
PhpDumper::dumpValue in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
Dumps values.

File

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

Class

PhpDumper
PhpDumper dumps a service container as a PHP class.

Namespace

Symfony\Component\DependencyInjection\Dumper

Code

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);
  }
}