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);