Skip to content

Commit

Permalink
refactor #164 Fix deprecation for symfony/config 4.2+ (Jibbarth)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.3 branch.

Discussion
----------

Fix deprecation for symfony/config 4.2

Fixed the same way as in symfony/maker-bundle#324

Commits
-------

bec5182 Fix deprecation for symfony/config 4.2+
  • Loading branch information
lchrusciel authored Apr 18, 2019
2 parents 956ec89 + bec5182 commit 67982d8
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 67982d8

Please sign in to comment.