Skip to content
This repository has been archived by the owner on Sep 18, 2022. It is now read-only.

Commit

Permalink
Removed deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Dec 24, 2018
1 parent 9d18554 commit 236d792
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/DependencyInjection/Configuration.php
Expand Up @@ -22,13 +22,17 @@ final class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$treeBuilder = new TreeBuilder('core23_sitemap');

/** @var ArrayNodeDefinition $node */
$node = $treeBuilder->root('core23_sitemap');
// Keep compatibility with symfony/config < 4.2
if (!\method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->root('core23_sitemap');
} else {
$rootNode = $treeBuilder->getRootNode();
}

$this->addStaticUrlsSection($node);
$this->addCacheSection($node);
$this->addStaticUrlsSection($rootNode);
$this->addCacheSection($rootNode);

return $treeBuilder;
}
Expand Down

0 comments on commit 236d792

Please sign in to comment.