Skip to content

Commit

Permalink
Merge pull request #483 from karser/fix-root-node-deprecation
Browse files Browse the repository at this point in the history
Fix root node deprecation in symfony/config > 4.1
  • Loading branch information
makasim authored Jan 3, 2019
2 parents b039845 + 0a36dca commit 63a9baf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions DependencyInjection/MainConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ public function __construct(array $storageFactories)
*/
public function getConfigTreeBuilder()
{
$tb = new TreeBuilder();
$rootNode = $tb->root('payum');
if (method_exists(TreeBuilder::class, 'getRootNode')) {
$tb = new TreeBuilder('payum');
$rootNode = $tb->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$tb = new TreeBuilder();
$rootNode = $tb->root('payum');
}

$securityNode = $rootNode->children()
->arrayNode('security')->isRequired()
Expand Down

0 comments on commit 63a9baf

Please sign in to comment.