Skip to content

Commit

Permalink
Fix root node deprecation in symfony/config > 4.1 (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
karser authored and Nyholm committed Dec 19, 2018
1 parent d19e832 commit 801e523
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 @@ -13,8 +13,14 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('bm_backup_manager');
if (method_exists(TreeBuilder::class, 'getRootNode')) {
$treeBuilder = new TreeBuilder('bm_backup_manager');
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('bm_backup_manager');
}

$rootNode
->children()
Expand Down

0 comments on commit 801e523

Please sign in to comment.