Implements \Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process().
Overrides CompilerPassInterface::process
public function process(ContainerBuilder $container) {
if (!$container
->hasDefinition('kernel_destruct_subscriber')) {
return;
}
$definition = $container
->getDefinition('kernel_destruct_subscriber');
$services = $container
->findTaggedServiceIds('needs_destruction');
foreach ($services as $id => $attributes) {
$definition
->addMethodCall('registerService', array(
$id,
));
}
}