Skip to content

Commit

Permalink
Merge pull request #1799 from phansys/config
Browse files Browse the repository at this point in the history
Backport #1457 for 2.x
  • Loading branch information
GuilhemN authored Mar 23, 2021
2 parents 2b39523 + b54c493 commit 1581495
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$treeBuilder
->root('nelmio_api_doc')
$treeBuilder = new TreeBuilder('nelmio_api_doc');

if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// symfony < 4.2 support
$rootNode = $treeBuilder->root('nelmio_api_doc');
}

$rootNode
->children()
->scalarNode('name')->defaultValue('API documentation')->end()
->arrayNode('exclude_sections')
Expand Down

0 comments on commit 1581495

Please sign in to comment.