Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

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 f070631 commit 8d70778
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/DependencyInjection/Configuration.php
Expand Up @@ -30,8 +30,15 @@ class Configuration implements \Symfony\Component\Config\Definition\Configuratio

public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root(static::ROOT_NAME);
$treeBuilder = new TreeBuilder(static::ROOT_NAME);

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

$rootNode->addDefaultsIfNotSet();

$this->addLogDirectory($rootNode);
Expand Down

0 comments on commit 8d70778

Please sign in to comment.