Skip to content

MicroKernel: Attach Kernel as Subscriber if implementing interface #16982

Closed
@beberlei

Description

@beberlei

I used MicroKernel for a very small migration project in Doctrine today where we redirect all the old Jira issues to their new Github counterparts. I want to handle all errors and not founds with the MicroKernel as well, but that requires implementing and registering a listener for kernel.exception, though it could be possible to just have the Kernel be a listener.

doctrine/doctrine-website-sphinx@ea99337

I propose to extend MicroKernelTrait to register itself as a subscriber on event_dispatcher, if it implements the EventSubscriberInterface. Not sure how to do that in a simple way, it probably involves adding a CompilerPass that is added to the ContainerBuilder in MicroKernelTrait::registerContainerConfiguration.

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