function RegisterServicesForDestructionPass::process

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterServicesForDestructionPass.php \Drupal\Core\DependencyInjection\Compiler\RegisterServicesForDestructionPass::process()
  2. 10 core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterServicesForDestructionPass.php \Drupal\Core\DependencyInjection\Compiler\RegisterServicesForDestructionPass::process()
  3. 9 core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterServicesForDestructionPass.php \Drupal\Core\DependencyInjection\Compiler\RegisterServicesForDestructionPass::process()
  4. 8.9.x core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterServicesForDestructionPass.php \Drupal\Core\DependencyInjection\Compiler\RegisterServicesForDestructionPass::process()

File

core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterServicesForDestructionPass.php, line 23

Class

RegisterServicesForDestructionPass
Adds services to the "kernel.destructable_services" container parameter.

Namespace

Drupal\Core\DependencyInjection\Compiler

Code

public function process(ContainerBuilder $container) : void {
  $service_ids = array_values(array_map(strval(...), $this->findAndSortTaggedServices('needs_destruction', $container)));
  $container->setParameter('kernel.destructable_services', $service_ids);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.