Skip to content

Commit

Permalink
Merge pull request #853 from stof/fix_deprecation
Browse files Browse the repository at this point in the history
Fix deprecation for symfony/config 4.2+
  • Loading branch information
kimhemsoe committed Oct 19, 2018
2 parents 3219f3f + e711bed commit 3ed47e7
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 3ed47e7

Please sign in to comment.