dunglas / DunglasActionBundle

Symfony controllers, redesigned
https://dunglas.fr/2016/01/dunglasactionbundle-symfony-controllers-redesigned/
MIT License
256 stars 14 forks source link

Auto inject the logger #61

Closed pierredup closed 7 years ago

pierredup commented 7 years ago

Auto inject the logger for classes implementing the LoggerAwareInterface (the same way the container is done for instances of ContainerAwareInterface)

dunglas commented 7 years ago

Hi @pierredup,

What do you think about waiting for symfony/symfony#20167 to be merge, then we can update this bundle to have a generic solution for setter autowiring.

Best regards

pierredup commented 7 years ago

Hi

Sure, but wouldn't that then mean a minimum Symfony requirement of 3.3, which might cause some issues with other projects?

dunglas commented 7 years ago

Indeed it will work only with Symfony 3.3, but until its release you can typehint the logger in the constructor.

pierredup commented 7 years ago

My concern is not the release date of Symfony 3.3, it's the compatibility.

For example, api-platform currently explicitly requires Symfony 3.1, which would then be incompatible if this bundle requires >= 3.3. Bumping the requirement would also mean dropping Symfony 2.8 support for this bundle. So if you are happy making Symfony 3.3 the minimum requirement for this bundle, then I'm happy to wait for that PR to be merged