Problem/Motivation

#3049525: Enable service autowiring by adding interface aliases to core service definitions added service aliases to allow for autowiring services. There is a service alias @event_dispatcher for event dispatcher (Symfony\Contracts\EventDispatcher\EventDispatcherInterface). However, in order to allow autowiring services which typehint against Psr\EventDispatcher\EventDispatcherInterface, that interface should be added as an additional alias.

Steps to reproduce

Proposed resolution

Add Psr\EventDispatcher\EventDispatcherInterface: '@event_dispatcher' to core.services.yml.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3401331

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

znerol created an issue. See original summary.

znerol’s picture

Status: Active » Needs review

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

With my limited knowledge of autowire, mainly reviewing other tickets, don't see any issue with this

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Why not, if it makes autowiring simpler. This is borderline for backporting, can't see it causing any problems but also if you want this you can probably wait until 10.3.

Committed 1d405d1 and pushed to 11.x. Thanks!

  • longwave committed 1d405d11 on 11.x
    Issue #3401331 by znerol: Add Psr\EventDispatcher\...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.