Skip to content

Commit

Permalink
Merge pull request #57 from Lutacon/deprecation_tree_builder
Browse files Browse the repository at this point in the history
Fix deprecation for symfony/config 4.2
  • Loading branch information
wjzijderveld authored Mar 27, 2019
2 parents fbb6d03 + d1dfea8 commit 8198c52
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,15 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('broadway');
$treeBuilder = new TreeBuilder('broadway');

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

$rootNode
->children()
Expand Down

0 comments on commit 8198c52

Please sign in to comment.