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,
  );
}
doc_Drupal
2016-10-29 09:32:37
Comments
Leave a Comment

Please login to continue.