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

Breadcrumb

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

function Container::reset

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

Resets shared services from the container.

The container is not intended to be used again after being reset in a normal workflow. This method is meant as a way to release references for ref-counting. A subsequent call to ContainerInterface::get() will recreate a new instance of the shared service.

Overrides ResetInterface::reset

File

core/lib/Drupal/Component/DependencyInjection/Container.php, line 203

Class

Container
Provides a container optimized for Drupal's needs.

Namespace

Drupal\Component\DependencyInjection

Code

public function reset() : void {
    $this->services = [];
}

API Navigation

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