Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0 #51

Open
dsands opened this issue May 18, 2019 · 2 comments · May be fixed by #52

Comments

@dsands
Copy link

dsands commented May 18, 2019

No description provided.

@dsands
Copy link
Author

dsands commented May 18, 2019

{▼
/Users/david/Projects/axis/vendor/symfony/config/Definition/Builder/TreeBuilder.php:30 {▶}
/Users/david/Projects/axis/vendor/ci/restclientbundle/Circle/RestClientBundle/DependencyInjection/Configuration.php:39 {▼
› {
› $treeBuilder = new TreeBuilder();
› $rootNode = $treeBuilder->root('circle_rest_client');
}
}

@dsands
Copy link
Author

dsands commented May 18, 2019

Seems to fix and maintain backward compatibility:

// $treeBuilder = new TreeBuilder();
// $rootNode = $treeBuilder->root('circle_rest_client');
if (method_exists(TreeBuilder::class, 'getRootNode')) {
$treeBuilder = new TreeBuilder('circle_rest_client');
$rootNode = $treeBuilder->getRootNode();
} else {
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('circle_rest_client');
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant