Skip to content

Commit

Permalink
Fix deprecate TreeBuilder::root
Browse files Browse the repository at this point in the history
A tree builder without a root node is deprecated since Symfony 4.2 and is not supported anymore in 5.0.
  • Loading branch information
Etrimi authored Oct 22, 2021
1 parent 75fabcc commit a2d4b9d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('swm_mailhook');
$treeBuilder = new TreeBuilder('swm_mailhook');
if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
$rootNode = $treeBuilder->root('swm_mailhook');
}

$this->addConfig($rootNode);

Expand Down

0 comments on commit a2d4b9d

Please sign in to comment.