From 06ae49d854838b2dcf8174a3b4d0cb41b6e80393 Mon Sep 17 00:00:00 2001 From: Arend-Jan Tetteroo Date: Mon, 3 Dec 2018 17:15:07 +0100 Subject: [PATCH] Fix symfony 4.2 treebuilder deprecation --- DependencyInjection/Configuration.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 497dcd6..610ccb9 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -26,9 +26,9 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('mongo_db_migrations', 'array'); - + $treeBuilder = new TreeBuilder('mongo_db_migrations', 'array'); + $rootNode = method_exists(TreeBuilder::class, 'getRootNode') ? $treeBuilder->getRootNode() : $treeBuilder->root('mongo_db_migrations', 'array'); + $rootNode ->children() ->scalarNode('collection_name')->defaultValue('migration_versions')->cannotBeEmpty()->end()