From 32bf4fd7a892663acc85f5942e6cbd22658da52d Mon Sep 17 00:00:00 2001 From: Martin Hujer Date: Fri, 30 Nov 2018 18:09:05 +0100 Subject: [PATCH] Fix deprecation for symfony/config 4.2 --- DependencyInjection/Configuration.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 7f03e05..51330f4 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -14,8 +14,14 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root("white_october_breadcrumbs"); + $treeBuilder = new TreeBuilder("white_october_breadcrumbs"); + + if (method_exists($treeBuilder, 'getRootNode')) { + $rootNode = $treeBuilder->getRootNode(); + } else { + // BC layer for symfony/config 4.1 and older + $rootNode = $treeBuilder->root("white_october_breadcrumbs"); + } $rootNode-> children()->