8000 [TwigBundle] move deprecation notice for the twig.form.resources conf… · symfony/symfony@7f8f81e · GitHub
[go: up one dir, main page]

Skip to content

Commit 7f8f81e

Browse files
author
Hugo Hamon
committed
[TwigBundle] move deprecation notice for the twig.form.resources configuration key in the TwigExtension class.
1 parent 0221e1c commit 7f8f81e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ private function addFormSection(ArrayNodeDefinition $rootNode)
5454
return count($v['form']['resources']) > 0;
5555
})
5656
->then(function ($v) {
57-
trigger_error('The twig.form.resources configuration key is deprecated since version 2.6 and will be removed in 3.0. Use the twig.form_themes configuration key instead.', E_USER_DEPRECATED);
58-
5957
$v['form_themes'] = array_values(array_unique(array_merge($v['form']['resources'], $v['form_themes'])));
6058

6159
return $v;

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ class TwigExtension extends Extension
3333
*/
3434
public function load(array $configs, ContainerBuilder $container)
3535
{
36+
// Check deprecation before the config is processed to ensure
37+
// the settings has been explicitly defined in a configuration file.
38+
if (isset($configs['form']['resources'])) {
39+
trigger_error('The twig.form.resources configuration key is deprecated since version 2.6 and will be removed in 3.0. Use the twig.form_themes configuration key instead.', E_USER_DEPRECATED);
40+
}
41+
3642
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
3743
$loader->load('twig.xml');
3844

0 commit comments

Comments
 (0)
0