mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Fix: Deprecation: A tree builder without a root node is deprecated since symfony 4.2 (#1457)
* Fix: Deprecation: A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0. * Fix: Deprecation: A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0.
This commit is contained in:
parent
b9718f3400
commit
056087cbbf
@ -18,9 +18,16 @@ class Configuration implements ConfigurationInterface
|
|||||||
{
|
{
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder();
|
$treeBuilder = new TreeBuilder('nelmio_api_doc');
|
||||||
$treeBuilder
|
|
||||||
->root('nelmio_api_doc')
|
if (method_exists($treeBuilder, 'getRootNode')) {
|
||||||
|
$rootNode = $treeBuilder->getRootNode();
|
||||||
|
} else {
|
||||||
|
// symfony < 4.2 support
|
||||||
|
$rootNode = $treeBuilder->root('nelmio_api_doc');
|
||||||
|
}
|
||||||
|
|
||||||
|
$rootNode
|
||||||
->children()
|
->children()
|
||||||
->scalarNode('name')->defaultValue('API documentation')->end()
|
->scalarNode('name')->defaultValue('API documentation')->end()
|
||||||
->arrayNode('exclude_sections')
|
->arrayNode('exclude_sections')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user