diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index a3ff5cb9..cb374e4c 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -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);