Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[FrameworkBundle] Deprecate ContainerAwareCommand#28415
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
d962935 to744bf0eComparechalasr commentedSep 10, 2018
rebased |
fabpot commentedSep 10, 2018
Thank you@chalasr. |
…lasr)This PR was merged into the 4.2-dev branch.Discussion----------[FrameworkBundle] Deprecate ContainerAwareCommand| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | yes| Tests pass? | yes| Fixed tickets | n/a| License | MIT| Doc PR |symfony/symfony-docs#10307Follow up of the recent `Controller` deprecation.I think people are widely used to register their commands as services and use proper dependency injection, we made the move for core commands in 3.4, let's deprecate `ContainerAwareCommand` for 4.2.Commits-------744bf0e [FrameworkBundle] Deprecate ContainerAwareCommand
…AwareCommand (chalasr, javiereguiluz)This PR was merged into the master branch.Discussion----------[Console] Remove mentions about the deprecated ContainerAwareCommandRelated tosymfony/symfony#28415Commits-------4143835 Maintained a note about ContainerAwareCommand being deprecatedf3e8f0e [WCM][Console] Remove mentions about the deprecated ContainerAwareCommand class
Tobion commentedOct 11, 2018
The swiftmailer-bundle (https://github.com/symfony/swiftmailer-bundle/tree/master/Command) and doctrine-bundle (https://github.com/doctrine/DoctrineBundle/blob/master/Command/DoctrineCommand.php) need to be fixed for this. |
HTMLGuyLLC commentedMar 28, 2019
Ok, so I was updating my code to remove this deprecated class and I ran into a potential roadblock. Without rewriting code, how can I call a controller in a command without the container being accessible like it was previously? |
chalasr commentedMar 29, 2019
@HTMLGuyLLC The deprecation notice says "use dependency-injection instead". Your controller is a service, you should be able to inject it in your command as any dependency. |
HTMLGuyLLC commentedMar 29, 2019
@chalasr I know what it says and that's what I'm doing with all my other dependencies. I didn't know the container was a service. Thank you. |
Uh oh!
There was an error while loading.Please reload this page.
Follow up of the recent
Controllerdeprecation.I think people are widely used to register their commands as services and use proper dependency injection, we made the move for core commands in 3.4, let's deprecate
ContainerAwareCommandfor 4.2.