Skip to content

Commit

Permalink
Fixed TreeBuilder::root() symfony 4.3 deprecation (#21)
Browse files Browse the repository at this point in the history
* Fixed symfony 4.2 deprecation

The "Symfony\Component\Config\Definition\Builder\TreeBuilder::root()" method called for the "qp_woohoolabs_yin" configuration is deprecated since Symfony 4.3, pass the root name to the constructor instead

* [patch-1] Use BC layer for deprecation in symfony/config

see symfony/maker-bundle#324 and doctrine/DoctrineBundle#853

Remove the BC layer when bump to next major version.
  • Loading branch information
Doqnach authored and qpautrat committed Dec 17, 2019
1 parent 8a324dd commit 5e6b8b1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/DependencyInjection/Configuration.php
Expand Up @@ -14,8 +14,14 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('qp_woohoolabs_yin');
$treeBuilder = new TreeBuilder('qp_woohoolabs_yin');

if (\method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode = $treeBuilder->root('qp_woohoolabs_yin');
}

$rootNode
->children()
Expand Down

0 comments on commit 5e6b8b1

Please sign in to comment.