Skip to content

Commit 4c84578

Browse files
committed
feature symfony#54657 [TwigBundle] Deprecate base_template_class option (Steveb-p)
This PR was merged into the 7.1 branch. Discussion ---------- [TwigBundle] Deprecate `base_template_class` option | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Issues | <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT According to https://github.com/twigphp/Twig/blob/3.x/CHANGELOG#L222, `base_template_class` option has been removed from Twig 3.0. Symfony still allows to pass this configuration option via https://github.com/symfony/symfony/blob/7.1/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php#L132, but there is of course no effect. I think it would be good to deprecate it and prepare it's removal in 8.x? Since Symfony 7.x requires Twig 3.x. <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Commits ------- c30d14f Deprecate Twig Bundle `base_template_class` option
2 parents 03e0318 + c30d14f commit 4c84578

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ private function addTwigOptions(ArrayNodeDefinition $rootNode): void
129129
->children()
130130
->scalarNode('autoescape_service')->defaultNull()->end()
131131
->scalarNode('autoescape_service_method')->defaultNull()->end()
132-
->scalarNode('base_template_class')->example('Twig\Template')->cannotBeEmpty()->end()
132+
->scalarNode('base_template_class')
133+
->setDeprecated('symfony/twig-bundle', '7.1')
134+
->example('Twig\Template')
135+
->cannotBeEmpty()
136+
->end()
133137
->scalarNode('cache')->defaultValue('%kernel.cache_dir%/twig')->end()
134138
->scalarNode('charset')->defaultValue('%kernel.charset%')->end()
135139
->booleanNode('debug')->defaultValue('%kernel.debug%')->end()

0 commit comments

Comments
 (0)