From f0fd6808f9c7e415ed90274ffdc5dc527187c388 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 3 Dec 2018 21:37:24 +0100 Subject: [PATCH] Fix deprecation in SF 4.2 --- src/DependencyInjection/Configuration.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 9ec2bf6..69a098c 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -26,16 +26,21 @@ final class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('tla_grabzit'); - + $treeBuilder = new TreeBuilder('tla_grabzit'); + + if (method_exists($treeBuilder,'getRootNode')) { + $rootNode = $treeBuilder->getRootNode(); + } else { + $rootNode = $treeBuilder->root('tla_grabzit'); + } + $rootNode ->children() ->scalarNode('key')->defaultNull()->end() ->scalarNode('secret')->defaultNull()->end() ->end() ; - + return $treeBuilder; } }