File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,11 @@ function dcg_create_application() {
4141// it is not possible to maintain the same \Twig\Environment sub-class for both
4242// Twig versions.
4343$ twig_environment_class = sprintf ('DrupalCodeGenerator\Twig\Twig%dEnvironment ' , $ twig_major_version );
44- class_alias ($ twig_environment_class , 'DrupalCodeGenerator\Twig\TwigEnvironment ' );
44+ if (!class_exists ('DrupalCodeGenerator\Twig\TwigEnvironment ' )) {
45+ class_alias ($ twig_environment_class , 'DrupalCodeGenerator\Twig\TwigEnvironment ' );
46+ }
4547
4648// Legacy TwigEnvironment class is still used in Drush.
47- class_alias ($ twig_environment_class , 'DrupalCodeGenerator\TwigEnvironment ' );
49+ if (!class_exists ('DrupalCodeGenerator\TwigEnvironment ' )) {
50+ class_alias ($ twig_environment_class , 'DrupalCodeGenerator\TwigEnvironment ' );
51+ }
You can’t perform that action at this time.
0 commit comments