Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Messenger] Configure a handler to subscribe to messages by their interface/parent class #27076

Copy link
Copy link
Closed
@kbond

Description

@kbond
Issue body actions
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes
Symfony version 4.1

With MessageSubscriberInterface::getHandledMessages() we can return an array of classes that should be handled but this requires knowing the exact classes before hand. What if we wanted all messages that implement an interface to be handled by a handler?

One solution I came up with was to loop through get_declared_classes() in MessageSubscriberInterface::getHandledMessages() and return the classes that implement an interface but this seems clunky (and perhaps error prone).

Any thoughts on how we can handle this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.