You are here

protected function PhpArrayDumper::getServiceCall in Service Container 7

Same name in this branch
  1. 7 lib/Drupal/Core/DependencyInjection/Dumper/PhpArrayDumper.php \Drupal\Core\DependencyInjection\Dumper\PhpArrayDumper::getServiceCall()
  2. 7 lib/Drupal/Component/DependencyInjection/Dumper/PhpArrayDumper.php \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper::getServiceCall()
Same name and namespace in other branches
  1. 7.2 lib/Drupal/Component/DependencyInjection/Dumper/PhpArrayDumper.php \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper::getServiceCall()

Gets a service reference for an ID in a suitable PHP array format.

Parameters

string $id: The ID of the service to get a reference for.

int $invalid_behavior: (optional) The invalid behavior of the service.

Return value

string|\stdClass A suitable representation of the service reference.

Overrides OptimizedPhpArrayDumper::getServiceCall

File

lib/Drupal/Component/DependencyInjection/Dumper/PhpArrayDumper.php, line 55
Contains \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper.

Class

PhpArrayDumper
PhpArrayDumper dumps a service container as a PHP array.

Namespace

Drupal\Component\DependencyInjection\Dumper

Code

protected function getServiceCall($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
  if ($invalid_behavior !== ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
    return '@?' . $id;
  }
  return '@' . $id;
}