class ContainerBuilder extends ContainerBuilder (View source)

Drupal's dependency injection container builder.

Submit upstream patches to Symfony to not require these overrides.

Methods

__construct(ParameterBagInterface $parameterBag = NULL)

{@inheritdoc}

shareService(Definition $definition, $service, $id, array $inlineServices)

A 1to1 copy of parent::shareService.

set($id, $service)

Overrides Symfony\Component\DependencyInjection\ContainerBuilder::set().

Definition
register($id, $class = null)

{@inheritdoc}

Alias
setAlias($alias, $id)

{@inheritdoc}

Definition
setDefinition($id, Definition $definition)

{@inheritdoc}

setParameter($name, $value)

{@inheritdoc}

callMethod($service, $call, array $inlineServices = array())

A 1to1 copy of parent::callMethod.

__sleep()

{@inheritdoc}

Details

__construct(ParameterBagInterface $parameterBag = NULL)

{@inheritdoc}

Parameters

ParameterBagInterface $parameterBag

protected shareService(Definition $definition, $service, $id, array $inlineServices)

A 1to1 copy of parent::shareService.

https://www.drupal.org/project/drupal/issues/2937010 Since Symfony 3.4 this is not a 1to1 copy.

Parameters

Definition $definition
$service
$id
array $inlineServices

set($id, $service)

Overrides Symfony\Component\DependencyInjection\ContainerBuilder::set().

Drupal's container builder can be used at runtime after compilation, so we override Symfony's ContainerBuilder's restriction on setting services in a frozen builder.

Restrict this to synthetic services only. Ideally, the upstream ContainerBuilder class should be fixed to allow setting synthetic services in a frozen builder.

Parameters

$id
$service

Definition register($id, $class = null)

{@inheritdoc}

Parameters

$id
$class

Return Value

Definition

Alias setAlias($alias, $id)

{@inheritdoc}

Parameters

$alias
$id

Return Value

Alias

Definition setDefinition($id, Definition $definition)

{@inheritdoc}

Parameters

$id
Definition $definition

Return Value

Definition

setParameter($name, $value)

{@inheritdoc}

Parameters

$name
$value

protected callMethod($service, $call, array $inlineServices = array())

A 1to1 copy of parent::callMethod.

https://www.drupal.org/project/drupal/issues/2937010 Since Symfony 3.4 this is not a 1to1 copy.

Parameters

$service
$call
array $inlineServices

__sleep()

{@inheritdoc}