diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c086d3..4e5e028 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,3 +14,4 @@ master * Fix Coveralls tool export * Fix badges * Disable audit of Log (cf. https://sonata-project.org/bundles/doctrine-orm-admin/master/doc/reference/audit.html) +* Remove deprecation about configuration tree builder without a root node diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 139dda6..20e9379 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -28,8 +28,14 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('ekino_data_protection'); + // Keep compatibility with symfony/config < 4.2 + if (!method_exists(TreeBuilder::class, 'getRootNode')) { + $treeBuilder = new TreeBuilder(); + $rootNode = $treeBuilder->root('ekino_data_protection'); + } else { + $treeBuilder = new TreeBuilder('ekino_data_protection'); + $rootNode = $treeBuilder->getRootNode(); + } $rootNode ->children()