Skip to content

Commit

Permalink
bug #594 Fix deprecation for symfony/config 4.2 (mhujer)
Browse files Browse the repository at this point in the history
This PR was merged into the 5.2.x-dev branch.

Discussion
----------

Fix deprecation for symfony/config 4.2

Fixed the same way as in doctrine/DoctrineBundle#853

Closes #593

Commits
-------

7db9568 Fix deprecation for symfony/config 4.2
  • Loading branch information
artem0723 committed Nov 30, 2018
2 parents 6f53963 + fc896e8 commit 7e218bb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions DependencyInjection/Configuration.php
Expand Up @@ -29,8 +29,14 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('sensio_framework_extra', 'array');
$treeBuilder = new TreeBuilder('sensio_framework_extra');

if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode = $treeBuilder->root('sensio_framework_extra');
}

$rootNode
->children()
Expand Down

0 comments on commit 7e218bb

Please sign in to comment.