console-parallelization icon indicating copy to clipboard operation
console-parallelization copied to clipboard

Remove dependency on container in trait

Open Taluu opened this issue 6 years ago • 3 comments

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.

Taluu avatar Nov 03 '19 21:11 Taluu

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

theofidry avatar Nov 03 '19 22:11 theofidry

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...

Taluu avatar Nov 03 '19 23:11 Taluu

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

webmozart avatar Nov 07 '19 14:11 webmozart