Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
Fixes Symfony 4.2 deprecation messages (backwards compatible) (#887)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanvierkant authored May 10, 2019
1 parent 9452f8a commit 5cca7f7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('sg_datatables');
$treeBuilder = new TreeBuilder('sg_datatables');
if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode = $treeBuilder->root('sg_datatables');
}

$this->addDatatableSection($rootNode);

Expand Down

0 comments on commit 5cca7f7

Please sign in to comment.