-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add explanation of ContainerAware #4520
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
Actually, it relates to DependencyInjection. I believe it should be documented in the DI component docs and a small note to the controller book should be added, referencing this new article and stating that Symfony will automatically inject it for controllers. The same note can be added to the console command cookbook, stating that commands implementing this will have the same behaviour. |
Yea, I think this details is not too important - we basically just need a spot that mentions that it works for controllers (without "bogging down" the controller chapter) and console commands. I wouldn't want much more than this. @wouterj does it related to DI in any way? I'm not aware of a spot in that component that does anything with this interface. |
@weaverryan the ContainerAware family is included in the DependencyInjection component. While the component doesn't use it internally, people using the DependencyInjection in a custom framework could want to use it in the same way as Symfony does. So I consider it a feature of the component (just like the ContainerAwareEventDispatcher is also a feature of the EventDispatcher component). |
@wouterj Agreed - a note about it then too in the DI components sections, as you mentioned - thanks :) |
Closing it as "won't fix" because Symfony is rapidly moving away from ContainerAware. |
Before a #4433, we had a misplaced (because this is a section for beginners) explanation of ContainerAware (and ContainerAwareInterface and the trait). I think this should still be mentioned somewhere, though I'm not sure where (it relates only to the Symfony Framework).
The text was updated successfully, but these errors were encountered: