Skip to content

Commit

Permalink
Fix deprecation for symfony/config 4.2+
Browse files Browse the repository at this point in the history
  • Loading branch information
Jibbarth committed Apr 14, 2019
1 parent 29a2274 commit 33a74e5
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 @@ -14,8 +14,13 @@ final class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('acme_sylius_example_plugin');
$treeBuilder = new TreeBuilder('acme_sylius_example_plugin');
if (\method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode = $treeBuilder->root('acme_sylius_example_plugin');
}

return $treeBuilder;
}
Expand Down

0 comments on commit 33a74e5

Please sign in to comment.