You are here

protected function PhpArrayDumper::getPrivateService in Service Container 7.2

Same name and namespace in other branches
  1. 7 lib/Drupal/Core/DependencyInjection/Dumper/PhpArrayDumper.php \Drupal\Core\DependencyInjection\Dumper\PhpArrayDumper::getPrivateService()

Returns a private service definition in a suitable format.

Parameters

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

Return value

\stdClass A very lightweight private service value object.

2 calls to PhpArrayDumper::getPrivateService()
PhpArrayDumper::dumpCallable in lib/Drupal/Core/DependencyInjection/Dumper/PhpArrayDumper.php
Dumps callable to YAML format
PhpArrayDumper::dumpValue in lib/Drupal/Core/DependencyInjection/Dumper/PhpArrayDumper.php
Dumps the value to YAML format.

File

lib/Drupal/Core/DependencyInjection/Dumper/PhpArrayDumper.php, line 271
Contains \Drupal\Core\DependencyInjection\Dumper\PhpArrayDumper

Class

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

Namespace

Drupal\Core\DependencyInjection\Dumper

Code

protected function getPrivateService(Definition $definition) {
  $service_definition = $this
    ->getServiceDefinition($definition);
  $hash = sha1(serialize($service_definition));
  return (object) array(
    'type' => 'service',
    'id' => 'private__' . $hash,
    'value' => $service_definition,
  );
}