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

Commit

Permalink
Use asserts for type safe root config nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Dec 27, 2018
1 parent dc8ab25 commit c84ca4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Expand Up @@ -24,13 +24,13 @@ public function getConfigTreeBuilder()
{ {
$treeBuilder = new TreeBuilder('core23_sitemap'); $treeBuilder = new TreeBuilder('core23_sitemap');


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


$this->addStaticUrlsSection($rootNode); $this->addStaticUrlsSection($rootNode);
$this->addCacheSection($rootNode); $this->addCacheSection($rootNode);
Expand Down

0 comments on commit c84ca4a

Please sign in to comment.