Skip to content

Commit

Permalink
Fix deprecation for symfony/config 4.2+
Browse files Browse the repository at this point in the history
Heavily inspired by symfony/maker-bundle#324
  • Loading branch information
bits4breakfast authored Jan 5, 2019
1 parent 24651e2 commit 7134356
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder;
$treeBuilder->root('aws', 'variable');
// Most recent versions of TreeBuilder have a constructor
if (\method_exists(TreeBuilder::class, '__construct')) {
$treeBuilder = new TreeBuilder('aws', 'variable');
} else { // which is not the case for older versions
$treeBuilder = new TreeBuilder;
$treeBuilder->root('aws', 'variable');
}

return $treeBuilder;
}
Expand Down

0 comments on commit 7134356

Please sign in to comment.