Skip to content

[RFC] Move ContainerAwareCommand from FrameworkBundle to Console #23529

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

Closed
javiereguiluz opened this issue Jul 16, 2017 · 6 comments
Closed

[RFC] Move ContainerAwareCommand from FrameworkBundle to Console #23529

javiereguiluz opened this issue Jul 16, 2017 · 6 comments
Labels
Console FrameworkBundle RFC RFC = Request For Comments (proposals about features that you want to be discussed)

Comments

@javiereguiluz
Copy link
Member

Q A
Bug report? no
Feature request? no
BC Break report? no
RFC? yes
Symfony version 3.4

A few days ago, in the Symfony Slack someone (I think it was @gnugat) proposed to make this change, so I copy it here to discuss about this:

We could move ContainerAwareCommand from FrameworkBundle to Console.

@javiereguiluz javiereguiluz added Console FrameworkBundle RFC RFC = Request For Comments (proposals about features that you want to be discussed) labels Jul 16, 2017
@chalasr
Copy link
Member

chalasr commented Jul 16, 2017

Given the steps done toward registering commands as services and dependency lazy loading, I don't think we should go in this direction.
The only benefit for commands to be ContainerAware is to have very lazy dependencies (loaded only when called) but as of 3.3 we have better alternatives, the best being to make the command a service subscriber.
Actually, as of 3.4 I would consider extending ContainerAwareCommand a bad practice.

@ro0NL
Copy link
Contributor

ro0NL commented Jul 16, 2017

It depends on Application from the framework bundle anyway.. so that needs to be stripped; leaving you with implements ContainerAwareInterface + use ContainerAwareTrait bridging class.

You can do that in user land easily. I.e. we might as well deprecate ContainerAwareCommand once core doesnt use it anymore.

@gnugat
Copy link
Contributor

gnugat commented Jul 17, 2017

@chalasr so should we deprecate it?

@ro0NL FrameworkBundle's Application could also be moved to Console

@chalasr
Copy link
Member

chalasr commented Jul 17, 2017

@gnugat #21623 :) I may reopen, I think we need time for the community to be familiar with 3.3 features and best practices

@nicolas-grekas
Copy link
Member

👎 as is, ContainerAwareInterface is not the future, as explained by @chalasr

@javiereguiluz
Copy link
Member Author

Closing it because of the downvotes ... and because @chalasr may reopen a related (but better) proposal in the future. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Console FrameworkBundle RFC RFC = Request For Comments (proposals about features that you want to be discussed)
Projects
None yet
Development

No branches or pull requests

5 participants