Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ContainerBuilder.php

function ContainerBuilder::set

Same name in this branch
  1. 11.1.x vendor/symfony/dependency-injection/ContainerBuilder.php \Symfony\Component\DependencyInjection\ContainerBuilder::set()

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.

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

Overrides ContainerBuilder::set

File

core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php, line 40

Class

ContainerBuilder
Drupal's dependency injection container builder.

Namespace

Drupal\Core\DependencyInjection

Code

public function set($id, $service) : void {
    SymfonyContainer::set($id, $service);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal