Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

Commit

Permalink
Fix deprecation for symfony/config 4.2+
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu authored and OskarStark committed Dec 16, 2018
1 parent 118a201 commit 34fa80b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/CoreBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('sonata_core');
$treeBuilder = new TreeBuilder('sonata_core');

// Keep compatibility with symfony/config < 4.2
if (!\method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->root('sonata_core');
} else {
$rootNode = $treeBuilder->getRootNode();
}

$this->addFlashMessageSection($rootNode);
$this->addSerializerFormats($rootNode);
Expand Down

0 comments on commit 34fa80b

Please sign in to comment.