Skip to content

Exception when reflecting console Application class. #8200

Closed
@jmalloc

Description

@jmalloc

The Console\Application::setDispatcher() method added in PR #7466 references EventDispatcherInterface as a type hint, however symfony/event-dispatcher is not listed as a runtime Composer dependency.

This has caused a BC breakage when using reflection on the console Application class, in the form of the following exception:

ReflectionException: Class Symfony\Component\EventDispatcher\EventDispatcherInterface does not exist

I'm not sure how this should be fixed, two possible solutions come to mind:

  • Promote symfony/event-dispatcher from require-dev to require
  • Do not use a type-hint on Application::setDispatcher()

As a workaround we've manually added symfony/event-dispatcher to our project's composer.json, but this does not feel like a good solution as our app does not use the event features at all.

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