Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Commit

Permalink
BC layer for symfony/config 4.1 and older
Browse files Browse the repository at this point in the history
  • Loading branch information
kunicmarko20 committed Aug 12, 2020
1 parent 5ce9113 commit 075f04d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('sonata_importer');

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

$rootNode
->children()
->arrayNode('templates')
->addDefaultsIfNotSet()
Expand Down

0 comments on commit 075f04d

Please sign in to comment.