diff --git a/composer.json b/composer.json index a6cc9c4..40208c2 100644 --- a/composer.json +++ b/composer.json @@ -20,8 +20,8 @@ }, "require": { "php": ">=5.6", - "symfony/framework-bundle": "~2.7|~3.0|~4.0", - "symfony/security-bundle": "~2.7|~3.0|~4.0", + "symfony/framework-bundle": "~2.7|~3.0|~4.0|~5.0", + "symfony/security-bundle": "~2.7|~3.0|~4.0|~5.0", "lightsaml/symfony-bridge": "~1.3" }, "require-dev": { diff --git a/src/LightSaml/SpBundle/DependencyInjection/Configuration.php b/src/LightSaml/SpBundle/DependencyInjection/Configuration.php index 192625b..f11dc59 100644 --- a/src/LightSaml/SpBundle/DependencyInjection/Configuration.php +++ b/src/LightSaml/SpBundle/DependencyInjection/Configuration.php @@ -25,8 +25,14 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - $root = $treeBuilder->root('light_saml_sp'); + $treeBuilder = new TreeBuilder('light_saml_sp'); + + if (method_exists($treeBuilder, 'getRootNode')) { + $root = $treeBuilder->getRootNode(); + } else { + // BC layer for symfony/config 4.1 and older + $root = $treeBuilder->root('light_saml_sp'); + } $root ->children()