Skip to content

Commit 03fa03e

Browse files
committed
Add support for Symfony 5
1 parent 2150175 commit 03fa03e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
},
2121
"require": {
2222
"php": ">=5.6",
23-
"symfony/framework-bundle": "~2.7|~3.0|~4.0",
24-
"symfony/security-bundle": "~2.7|~3.0|~4.0",
23+
"symfony/framework-bundle": "~2.7|~3.0|~4.0|~5.0",
24+
"symfony/security-bundle": "~2.7|~3.0|~4.0|~5.0",
2525
"lightsaml/symfony-bridge": "~1.3"
2626
},
2727
"require-dev": {

src/LightSaml/SpBundle/DependencyInjection/Configuration.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,14 @@ class Configuration implements ConfigurationInterface
2525
*/
2626
public function getConfigTreeBuilder()
2727
{
28-
$treeBuilder = new TreeBuilder();
29-
$root = $treeBuilder->root('light_saml_sp');
28+
$treeBuilder = new TreeBuilder('light_saml_sp');
29+
30+
if (method_exists($treeBuilder, 'getRootNode')) {
31+
$root = $treeBuilder->getRootNode();
32+
} else {
33+
// BC layer for symfony/config 4.1 and older
34+
$root = $treeBuilder->root('light_saml_sp');
35+
}
3036

3137
$root
3238
->children()

0 commit comments

Comments
 (0)