Enable service autowiring by adding interface aliases to core service definitions

Created on 19 April 2019, over 5 years ago
Updated 6 October 2023, about 1 year ago

Problem/Motivation

Symfony 4 will drop support for magic autowiring, expecting services to be aliased - see their docs and @weaverryan's Drupalcon session.

Proposed resolution

Add interface aliases to core services as described in Working with Interfaces, while keeping the existing service names intact.
Then update core services to use autowiring instead of explicit service names as arguments.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Drupal 10.1.0 fixes a bug in Drupal's dependency injection container that could allow certain private services to be accessed by $container->get() depending on code execution order. Custom or contributed module code accessing services in this way would have been fragile before the change, but will now always break. Public services are unaffected.

πŸ“Œ Task
Status

Fixed

Version

10.1 ✨

Component
BaseΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024