Skip to content

Commit

Permalink
Merge pull request #41 from N-M/N-M-fixed-tree-deprecation
Browse files Browse the repository at this point in the history
Fix: A tree builder without a root node is deprecated
  • Loading branch information
trandangtri committed Mar 6, 2019
2 parents f10102c + d7f91d0 commit 42fa14c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,20 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$tree = new TreeBuilder();
$rootNode = $tree->root('tritran_sqs_queue');
$treeBuilder = new TreeBuilder('tritran_sqs_queue');
// Keep compatibility with symfony/config < 4.2;
if (!method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->root('tritran_sqs_queue');
} else {
$rootNode = $treeBuilder->getRootNode();
}

$rootNode
->children()
->append($this->getSQSQueueNodeDef())
->end();

return $tree;
return $treeBuilder;
}

/**
Expand Down

0 comments on commit 42fa14c

Please sign in to comment.