Autowired services can't be used in ServiceProviderInterface

Created on 21 April 2024, 2 months ago

Problem/Motivation

ServiceProviderTestServiceProvider::alter has $container->get('module_handler'). If module handler itself or a service it receives is autowired, this fails because AutowireServicePass runs after ModifyServiceDefinitionsPass

Steps to reproduce

Convert module handler to autowire, watch the test fail.

Proposed resolution

Remove this call and document not to run $container->get from inside ServiceModifierInterface::alter. It is there to modify services, after all.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡¨πŸ‡¦Canada Charlie ChX Negyesi 🍁Canada

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

Comments & Activities

Production build 0.69.0 2024