diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 413033d..3683c20 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -14,8 +14,14 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('gregwar_captcha'); + $treeBuilder = new TreeBuilder('gregwar_captcha'); + + if (method_exists($treeBuilder, 'getRootNode')) { + $rootNode = $treeBuilder->getRootNode(); + } else { + // BC for symfony/config <= 4.1 + $rootNode = $treeBuilder->root('gregwar_captcha'); + } $rootNode ->addDefaultsIfNotSet()