File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 66 "ext-json" : " *" ,
77 "symfony/console" : " ^3.4 || ^4.0" ,
88 "symfony/filesystem" : " ^2.7 || ^3.4 || ^4.0" ,
9- "twig/twig" : " ^1.39 || ^2.10"
9+ "twig/twig" : " ^1.38.2 || ^2.10"
1010 },
1111 "bin" : [
1212 " bin/dcg"
Original file line number Diff line number Diff line change @@ -30,10 +30,16 @@ function dcg_create_application() {
3030 return ApplicationFactory::create ();
3131}
3232
33+ // Determine major Twig version.
34+ // Twig_Environment::MAJOR_VERSION is not suitable here because of
35+ // https://github.com/twigphp/Twig/pull/2945
36+ // Use this workaround as drupal/drupal is locked on Twig 1.38.
37+ list ($ twig_major_version ) = sscanf (Twig_Environment::VERSION , '%d.%d.%d ' );
38+
3339// Twig_Environment::tokenize() signature has been changed in Twig 2, so that
3440// it is not possible to maintain the same Twig_Environment sub-class for both
3541// Twig versions.
36- $ twig_environment_class = sprintf ('DrupalCodeGenerator\Twig\Twig%dEnvironment ' , Twig_Environment:: MAJOR_VERSION );
42+ $ twig_environment_class = sprintf ('DrupalCodeGenerator\Twig\Twig%dEnvironment ' , $ twig_major_version );
3743class_alias ($ twig_environment_class , 'DrupalCodeGenerator\Twig\TwigEnvironment ' );
3844
3945// Legacy TwigEnvironment class is still used in Drush.
You can’t perform that action at this time.
0 commit comments