From c5eac46e72285e3b2aef6c97236dc092c4d7bd03 Mon Sep 17 00:00:00 2001 From: YoannChabert Date: Thu, 19 Mar 2020 20:11:48 +0100 Subject: [PATCH 1/2] BC with FosRest last version --- DependencyInjection/Configuration.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 2f0cd252..cbe95c86 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -20,6 +20,12 @@ public function getConfigTreeBuilder(): TreeBuilder $defaults = $this->getTinymceDefaults(); $treeBuilder = new TreeBuilder('stfalcon_tinymce'); + if (method_exists($treeBuilder, 'getRootNode')) { + $rootNode = $treeBuilder->getRootNode(); + } else { + // BC layer for symfony/config 4.1 and older + $rootNode = $treeBuilder->root('stfalcon_tinymce'); + } return $treeBuilder ->getRootNode() From 58c4fc5a1d2ed100fffa907112264f7da8496110 Mon Sep 17 00:00:00 2001 From: YoannChabert Date: Fri, 20 Mar 2020 00:44:14 +0100 Subject: [PATCH 2/2] Fix root --- DependencyInjection/Configuration.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index cbe95c86..e50909f6 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -27,8 +27,7 @@ public function getConfigTreeBuilder(): TreeBuilder $rootNode = $treeBuilder->root('stfalcon_tinymce'); } - return $treeBuilder - ->getRootNode() + $rootNode ->children() // Include jQuery (true) library or not (false) ->booleanNode('include_jquery')->defaultFalse()->end() @@ -84,6 +83,8 @@ public function getConfigTreeBuilder(): TreeBuilder ->end() ->end() ->end(); + + return $treeBuilder; } /**