#111630Drop SingletonInterface from Context
Description
Context still implements SingletonInterface. It is a shared service in the container, so the marker is not needed to make it shared.
The marker should be replaced by #[Autoconfigure(public: true, shared: true)], so GeneralUtility::makeInstance() in third-party code keeps returning the shared container instance.
Core classes that are built by the container and still fetch the Context via GeneralUtility::makeInstance() should receive it via dependency injection instead. Classes that are created with “new”, static code and ViewHelpers keep using GeneralUtility::makeInstance().
Tests that replace the Context via GeneralUtility::setSingletonInstance() need to configure the shared instance from the container instead.
Follow-up of #110578.
Reviews 1
History 01
-
Gerrit Code Review pushed patch set 1 for main to change 98083 status
NewUnder Review 11/26/26, 20:33