Problem/Motivation

container.trait was added to help ContainerAware services.

Injecting the entire container is discouraged, dependency injection and service locators are preferred instead nowadays, and ContainerAwareTrait was deprecated in #3427741: Notify downstream users that ContainerAware is going away

We did not remove the container.trait definition at the time, but it's probably time to clean it up now.

Steps to reproduce

Proposed resolution

Remove container.trait from core.services.yml.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3618385

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

longwave created an issue. See original summary.

longwave’s picture

I don't think it's possible to deprecate an abstract service so I think we just drop this in main and forget about it.

longwave-bot made their first commit to this issue’s fork.

longwave’s picture

Status: Active » Needs review
longwave’s picture

Issue summary: View changes
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Seems straight forward

catch’s picture

Status: Reviewed & tested by the community » Fixed

I was wondering if we could make it non-abstact in 11.x and deprecate it there, but that seems like as bad of a change as just dropping it in main so let's just do that.

Committed/pushed to main, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • catch committed 03e37d38 on main
    task: #3618385 Remove container.trait service definition
    
    By: longwave