Skip to content

Commit

Permalink
[FrameworkBundle|TwigBundle] update functional tests configuration fi…
Browse files Browse the repository at this point in the history
…les to not use deprecated config keys anymore.
  • Loading branch information
Hugo Hamon committed Jan 9, 2015
1 parent bddd8b5 commit f3f561a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,21 @@ public function getConfigTreeBuilder()
private function addFormSection(ArrayNodeDefinition $rootNode)
{
$rootNode
// Check deprecation before the config is processed to ensure
// the setting has been explicitly defined in a configuration file.
->beforeNormalization()
->ifTrue(function ($v) { return isset($v['form']['resources']); })
->then(function ($v) {
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);

return $v;
})
->end()
->validate()
->ifTrue(function ($v) {
return count($v['form']['resources']) > 0;
})
->then(function ($v) {
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);

$v['form_themes'] = array_values(array_unique(array_merge($v['form']['resources'], $v['form_themes'])));

return $v;
Expand Down

0 comments on commit f3f561a

Please sign in to comment.