Skip to content

Commit

Permalink
Fix deprecation for symfony/config 4.2
Browse files Browse the repository at this point in the history
Fixed the same way as in doctrine/DoctrineBundle#853
  • Loading branch information
mhujer committed Nov 30, 2018
1 parent 9ef408f commit 162c8dd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions DependencyInjection/Configuration.php
Expand Up @@ -29,8 +29,14 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('sensio_framework_extra', 'array');
$treeBuilder = new TreeBuilder('sensio_framework_extra');

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

$rootNode
->children()
Expand Down

0 comments on commit 162c8dd

Please sign in to comment.