Skip to content

Commit

Permalink
fixed deprecation message of treebuilder (#51)
Browse files Browse the repository at this point in the history
* fixed deprecation message of treebuilder

* keep compability with symfony/config < 4.2
  • Loading branch information
Silas Joisten authored Jan 19, 2019
1 parent 0f9999b commit ed50b83
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('sonata_multi_upload');
$treeBuilder = new TreeBuilder('sonata_multi_upload');

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

$rootNode
->children()
Expand Down

0 comments on commit ed50b83

Please sign in to comment.