Convert KernelDestructionSubscriber to use configurators

Created on 14 January 2024, 10 months ago
Updated 30 January 2024, 10 months ago

Problem/Motivation

In 📌 Fork Symfony's ContainerAwareTrait and ContainerAwareInterface into core Needs work we are trying to reduce the use of ContainerAwareTrait as Symfony has deprecated it.

KernelDestructionSubscriber is container aware because it needs to retrieve services that can be destroyed.

KernelDestructionSubscriber needs to know all services that are tagged needs_destruction and have been instantiated.

Steps to reproduce

Proposed resolution

There are not many ways to hook into the container, but configurators do allow a single service to be notified when another service is instantiated.

So, at container build time we can mark all needs_destruction services as having KernelDestructionSubscriber as the configurator, and use the configurator method to track the services that need destruction. This avoids having to check which services are instantiated, because we are keeping track of them directly.

Remaining tasks

Decide if this is an abuse of the configurator principle.

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Closed: won't fix

Version

11.0 🔥

Component
Base 

Last updated about 8 hours ago

Created by

🇬🇧United Kingdom longwave UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024