-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Exception when reflecting console Application class. #8200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It is an optional dependency of the component as the dispatcher is optional (you don't need to set a dispatcher to use the application). this is why the component is listed in the suggestions. |
Oh yes, I can see that setting the dispatcher is optional to the core functionality, but we are not using the event features and as a result of this change a previously working application has broken. It's definitely not a huge problem, as adding event-dispatcher as a dependency has gotten us going again, but I do believe it's harmful to shift the responsibility of managing these dependencies to the end-project. Just my 2c :) |
Well, that's the whole point of optional dependencies. That you need to activate them when u need them which is apparently the case when doing reflection. |
Indeed, I did not anticipate the BC break when using PHP reflection. Sorry for the inconvenience, but unfortunately, I don't see what we can do to "fix" this. |
Well, one could argue that ANY change to class is a bc break when using reflection. |
The
Console\Application::setDispatcher()
method added in PR #7466 referencesEventDispatcherInterface
as a type hint, howeversymfony/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:I'm not sure how this should be fixed, two possible solutions come to mind:
symfony/event-dispatcher
fromrequire-dev
torequire
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.The text was updated successfully, but these errors were encountered: