Skip to content

Commit

Permalink
Merge pull request #262 from seizan8/master
Browse files Browse the repository at this point in the history
Fix: deprecated treebuilder initialisation for symfony 4.2+
  • Loading branch information
oallain authored May 19, 2021
2 parents 4fa98be + 8e34450 commit cc925e1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ final class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('');
$rootNode = $treeBuilder->getRootNode('fos_sylius_import_export');

if (\method_exists(TreeBuilder::class, 'getRootNode')) {
$treeBuilder = new TreeBuilder('fos_sylius_import_export');
$rootNode = $treeBuilder->getRootNode();
} else {
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('fos_sylius_import_export');
}

$rootNode
->children()
Expand Down

0 comments on commit cc925e1

Please sign in to comment.