From 39f6d529300a80bc7adf1ab4979225513aa5d7e3 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 8 Dec 2018 13:04:45 +0000 Subject: [PATCH] fix compatibility with Symfony Config 4.2 --- DependencyInjection/Configuration.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 84e8b454..3f984581 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -22,12 +22,13 @@ public function __construct($debug = false) public function getConfigTreeBuilder() { - $tb = new TreeBuilder(); + $tb = new TreeBuilder('jms_serializer'); - $root = $tb - ->root('jms_serializer', 'array') - ->children() - ; + if (method_exists($tb, 'getRootNode')) { + $root = $tb->getRootNode()->children(); + } else { + $root = $tb->root('jms_serializer')->children(); + } $this->addHandlersSection($root); $this->addSubscribersSection($root);