mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +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
edb54a1551
commit
7a5c8a2e0d
@ -18,9 +18,16 @@ final 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
|
||||||
->beforeNormalization()
|
->beforeNormalization()
|
||||||
->ifTrue(function ($v) {
|
->ifTrue(function ($v) {
|
||||||
return !isset($v['areas']) && isset($v['routes']);
|
return !isset($v['areas']) && isset($v['routes']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user