Skip to content

Commit f3f561a

Browse files
author
Hugo Hamon
committed
[FrameworkBundle|TwigBundle] update functional tests configuration files to not use deprecated config keys anymore.
1 parent bddd8b5 commit f3f561a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

DependencyInjection/Configuration.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,21 @@ public function getConfigTreeBuilder()
4949
private function addFormSection(ArrayNodeDefinition $rootNode)
5050
{
5151
$rootNode
52+
// Check deprecation before the config is processed to ensure
53+
// the setting has been explicitly defined in a configuration file.
54+
->beforeNormalization()
55+
->ifTrue(function ($v) { return isset($v['form']['resources']); })
56+
->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+
59+
return $v;
60+
})
61+
->end()
5262
->validate()
5363
->ifTrue(function ($v) {
5464
return count($v['form']['resources']) > 0;
5565
})
5666
->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-
5967
$v['form_themes'] = array_values(array_unique(array_merge($v['form']['resources'], $v['form_themes'])));
6068

6169
return $v;

0 commit comments

Comments
 (0)