Skip to content

Commit

Permalink
Update configuration.php for Sym 4.1+ and BC
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhoyt authored Feb 4, 2021
1 parent 5515504 commit acab299
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('dpn_xml_sitemap');

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

$rootNode
->children()
->scalarNode('http_cache')
Expand Down

0 comments on commit acab299

Please sign in to comment.