Skip to content

Remove dependency on container in trait #1

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
Taluu opened this issue Nov 3, 2019 · 3 comments · Fixed by #109
Closed

Remove dependency on container in trait #1

Taluu opened this issue Nov 3, 2019 · 3 comments · Fixed by #109
Labels
enhancement New feature or request

Comments

@Taluu
Copy link

Taluu commented Nov 3, 2019

As Symfony 4+ kinda deprecate injecting the whole container, wouldn't it make sense for the trait, rather than asking a getContainer method, ask for whatever it needs (a few parameters and the logger IIRC) ? So that these can be injected and used from a command as a service.

@theofidry
Copy link
Collaborator

Right now resetting the container every now and then is kinda necessary hence this dependency. That said I don't like it either and it might be worth exploring another way to do without it

@Taluu
Copy link
Author

Taluu commented Nov 3, 2019

Looks like it's only resetted when an error happens and if the container implements the resettable interface. So yeah, there should be a better way...

@webmozart
Copy link
Member

I agree that this would be great. Maybe we can add the reset to a separate trait. Ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants