Skip to content

Commit

Permalink
Merge pull request #54 from thePanz/patch-2
Browse files Browse the repository at this point in the history
Fix TreeBuilder() deprecation
  • Loading branch information
omansour authored May 24, 2019
2 parents 4d3f54e + 43d2701 commit ed0ae80
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/AmqpBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('m6_web_amqp');
$treeBuilder = new TreeBuilder('m6_web_amqp');

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

$rootNode
->children()
->booleanNode('debug')->defaultValue('%kernel.debug%')->end()
Expand Down

0 comments on commit ed0ae80

Please sign in to comment.