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

Commit

Permalink
Fixes Symfony 4.2 deprecation warning about TreeBuilder::_construct()…
Browse files Browse the repository at this point in the history
… calling without a parameter
  • Loading branch information
frostieDE authored and scheb committed Dec 2, 2018
1 parent 0e70714 commit 410d2b7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('scheb_two_factor');
$treeBuilder = new TreeBuilder('scheb_two_factor');

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

$rootNode
->children()
Expand Down

0 comments on commit 410d2b7

Please sign in to comment.