From 14f9d9eac9df6074f7643efdef9fa2828f33e800 Mon Sep 17 00:00:00 2001 From: robertfausk Date: Sun, 29 Mar 2020 17:45:23 +0200 Subject: [PATCH] Add compatibility for symfony/config 3.4 by fixing Error: Call to undefined method Symfony\Component\Config\Definition\Builder\TreeBuilder::getRootNode() --- src/ServiceContainer/PantherConfiguration.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ServiceContainer/PantherConfiguration.php b/src/ServiceContainer/PantherConfiguration.php index 75c89bc..aa1225c 100644 --- a/src/ServiceContainer/PantherConfiguration.php +++ b/src/ServiceContainer/PantherConfiguration.php @@ -33,7 +33,13 @@ public function addOptionsNode(): ArrayNodeDefinition { $treeBuilder = new TreeBuilder('options'); - $node = $treeBuilder->getRootNode() + if (\method_exists($treeBuilder, 'getRootNode')) { + $root = $treeBuilder->getRootNode(); + } else { + $root = $treeBuilder->root('options'); + } + + $node = $root ->info( "These are the options passed as first argument to PantherTestCaseTrait::createPantherClient client constructor." )