Skip to content

Commit

Permalink
Fix deprecation for symfony/config 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mhujer committed Nov 30, 2018
1 parent a2e30e1 commit ca6d4db
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 @@ -15,8 +15,14 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$treeBuilder->root('lexik_data_layer');
$treeBuilder = new TreeBuilder('lexik_data_layer');

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

return $treeBuilder;
}
Expand Down

0 comments on commit ca6d4db

Please sign in to comment.