bug #1431 Move setting $app['twig.app_variable'] after 'Symfony\Bridge\Twig' check (tiemevanveen)
This PR was merged into the 2.0.x-dev branch. Discussion ---------- Move setting $app['twig.app_variable'] after 'Symfony\Bridge\Twig' check Currently `TwigServiceProvider ` sets `$app['twig.app_variable']` to be function that has a dependency on classes that are not required by Silex. This will fail if the user then calls that function. This happens for example when the [silex-pimple-dumper](https://github.com/Sorien/silex-pimple-dumper) maps over the app and tries to dump it's content. This PR fixes that by moving this in the `class_exists('Symfony\Bridge\Twig\Extension\RoutingExtension')` check. I've also added comment because at first it wasn't clear for me that this check for the `RoutingExtension` was the check for the whole Twig bridge. Please feel free to rebase and remove it it you don't like it or I misinterpreted it. Keep up the good work!👍 Commits ------- b97f5a89 Move setting $app['twig.app_variable'] after 'Symfony\Bridge\Twig' check
Showing
Please register or sign in to comment