Skip to content

Commit

Permalink
Merge pull request #17 from bmaziere/remove-tree-builder-deprecation
Browse files Browse the repository at this point in the history
Remove deprecation about configuration tree builder without a root node
  • Loading branch information
mremi committed Aug 26, 2019
2 parents 04c4b28 + 51dd518 commit e5cd05c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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
10 changes: 8 additions & 2 deletions DependencyInjection/Configuration.php
Expand Up @@ -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()
Expand Down

0 comments on commit e5cd05c

Please sign in to comment.