Skip to content

Commit

Permalink
Merge pull request #35 from hacfi/sf_compat
Browse files Browse the repository at this point in the history
Fix Symfony 4.2 deprecations for TreeBuilder
  • Loading branch information
Burgov committed Mar 9, 2020
2 parents 45a5a17 + 1b2af22 commit 575b2fc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('burgov_key_value_form');
$treeBuilder = new TreeBuilder('burgov_key_value_form');

if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode = $treeBuilder->root('burgov_key_value_form');
}

// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
Expand Down

0 comments on commit 575b2fc

Please sign in to comment.