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
stof committed Sep 25, 2018
1 parent 9e6bb0b commit 03a9915
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions DependencyInjection/Configuration.php
Expand Up @@ -33,8 +33,14 @@ public function __construct($debug)
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('doctrine');
$treeBuilder = new TreeBuilder('doctrine');

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

$this->addDbalSection($rootNode);
$this->addOrmSection($rootNode);
Expand Down

0 comments on commit 03a9915

Please sign in to comment.