Skip to content
Permalink
Browse files

Use asserts for type safe root config nodes

  • Loading branch information...
core23 committed Dec 27, 2018
1 parent dc8ab25 commit c84ca4a9e9e1bcfa7f66f193b595cf09dd47ee44
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/DependencyInjection/Configuration.php
@@ -24,13 +24,13 @@ public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('core23_sitemap');
/* @var ArrayNodeDefinition $rootNode */
// Keep compatibility with symfony/config < 4.2
if (!\method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->root('core23_sitemap');
} else {
$rootNode = $treeBuilder->getRootNode();
}
\assert($rootNode instanceof ArrayNodeDefinition);
$this->addStaticUrlsSection($rootNode);
$this->addCacheSection($rootNode);

0 comments on commit c84ca4a

Please sign in to comment.
You can’t perform that action at this time.