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 ff42422 commit 2451969
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/DependencyInjection/Configuration.php
Expand Up @@ -22,8 +22,14 @@ public function __construct(

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

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

// @codingStandardsIgnoreStart tree is indented for better readability
$rootNode
Expand Down

0 comments on commit 2451969

Please sign in to comment.