protected function OptimizedPhpArrayDumper::getPrivateServiceCall

protected OptimizedPhpArrayDumper::getPrivateServiceCall($id, Definition $definition, $shared = FALSE)

Gets a private service definition in a suitable format.

Parameters

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

\Symfony\Component\DependencyInjection\Definition $definition: The definition to process.

bool $shared: (optional) Whether the service will be shared with others. By default this parameter is FALSE.

Return value

\stdClass A very lightweight private service value object.

File

core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php, line 373

Class

OptimizedPhpArrayDumper
OptimizedPhpArrayDumper dumps a service container as a serialized PHP array.

Namespace

Drupal\Component\DependencyInjection\Dumper

Code

protected function getPrivateServiceCall($id, Definition $definition, $shared = FALSE) {
  $service_definition = $this->getServiceDefinition($definition);
  if (!$id) {
    $hash = hash('sha1', serialize($service_definition));
    $id = 'private__' . $hash;
  }
  return (object) array(
    'type' => 'private_service',
    'id' => $id,
    'value' => $service_definition,
    'shared' => $shared,
  );
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!DependencyInjection!Dumper!OptimizedPhpArrayDumper.php/function/OptimizedPhpArrayDumper::getPrivateServiceCall/8.1.x