diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 0a7c3ae..e7245ed 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -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()