Open rvanlaak opened 4 years ago
Hi @rvanlaak. I agree with your proposition. We could move out the Twig dependency, however it is important to note that the reason why it is here is that templates and extensions depend on specific versions of Twig. Hence the dependency is here in order to ensure that only compatible versions of Twig are pulled, or that only a bundle compatible with the version of Twig used by the project is pulled.
I would be delighted if we could either move the Twig dependency to suggests, but that won't help restrict the actual version of Twig (which is used to ensure backward compatibility).
However, I definitely agree with the extension loading service definitions when the profiler class exists.
If you wish to open a PR, I would be glad to review it and merge it.
The conflicts section is there to solve that: https://getcomposer.org/doc/04-schema.md#conflict
What minimum version of Twig would be needed?
As mentioned in the composer.json: "^2.10 || ^3.0" are the only versions supported :)
Can you then move them to the conflicts
section, as we agree that it is not a hard dependency.
The hard dependency in
composer.json
on Twig can get removed, and the Twig related service definitions only have to get loaded whenprofiler
is available and enabled.Why?
Right now Twig is a hard requirement, although Twig does not need to be a dependency in this bundle.
The minimum usage gets visible when searching the codebase for Twig, it all is related to the profiler.
If userland did require
symfony/web-profiler-bundle
, that will take care of requiringtwig/twig
(see related composer.json).Proposed solution
CsaGuzzleExtension
load service definitions when profiler class exists (instead of removing them when disabled)