Skip to content

Commit

Permalink
Merge pull request #54 from bits4breakfast/patch-1
Browse files Browse the repository at this point in the history
Fix deprecation for symfony/config 4.2+
  • Loading branch information
howardlopez authored Feb 27, 2019
2 parents 81249a9 + 7134356 commit 6110ef3
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 6110ef3

Please sign in to comment.