Skip to content

Commit

Permalink
Merge pull request #44 from athos7933/fix/tree-build-4.2-v2
Browse files Browse the repository at this point in the history
Update TreeBuilder constructor next to symfony 4.2 deprecation V2
  • Loading branch information
Maxime Veber authored Mar 29, 2019
2 parents 57ad251 + fcaca09 commit 5238e5e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Knp/DictionaryBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$builder = new TreeBuilder();
$builder
->root('knp_dictionary')
$builder = new TreeBuilder('knp_dictionary');

if (method_exists($builder, 'getRootNode')) {
$rootNode = $builder->getRootNode();
} else {
// BC for symfony/config < 4.2
$rootNode = $builder->root('knp_dictionary');
}

$rootNode
->children()
->arrayNode('dictionaries')
->useAttributeAsKey('name')
Expand Down

0 comments on commit 5238e5e

Please sign in to comment.