class KernelDestructionSubscriber implements EventSubscriberInterface, ContainerAwareInterface (View source)

Destructs services that are initiated and tagged with "needs_destruction".

Traits

ContainerAwareTrait

Properties

protected array $services

Holds an array of service ID's that will require destruction.

Methods

registerService(string $id)

Registers a service for destruction.

onKernelTerminate(TerminateEvent $event)

Invoked by the terminate kernel event.

static array
getSubscribedEvents()

Registers the methods in this class that should be listeners.

Details

registerService(string $id)

Registers a service for destruction.

Calls to this method are set up in RegisterServicesForDestructionPass::process().

Parameters

string $id

Name of the service.

onKernelTerminate(TerminateEvent $event)

Invoked by the terminate kernel event.

Parameters

TerminateEvent $event

The event object.

static array getSubscribedEvents()

Registers the methods in this class that should be listeners.

Return Value

array

An array of event listener definitions.