Description
Symfony version(s) affected: 4.2.0-beta1
Description
It is possible to install TwigBundle without Symfony's new contracts package, but the bundle will register a Twig extension from the Twig bridge package for the translator that uses a trait from the contracts. Under certain circumstances, this will trigger a fatal error during cache warmup or template rendering.
How to reproduce
Reproducer: https://github.com/derrabus/symfony-reproducers/tree/bug/twig-without-contracts
If you run the application, you should get an exception on the /
route.
Possible Solution
Add the symfony/contracts
package to the dependencies of either symfony/twig-bridge
or symfony/twig-bundle
or remove the trait usage from Symfony\Bridge\Twig\Extension\TranslationExtension
.