Restore compatibiltiy with symfony/config v5

This commit is contained in:
Richard Henkenjohann committed 2021-11-26 15:24:09 +01:00
1 parent 0bb3d1f4d0
commit d83fbb5451
1 file changed
+8 -2
+8 -2
View File
@@ -20,8 +20,14 @@ final class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('terminal42_password_validation');
$treeBuilder = new TreeBuilder('terminal42_password_validation');
// Keep compatibility with symfony/config < 4.2
if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
$rootNode = $treeBuilder->root('terminal42_password_validation');
}
$rootNode
->useAttributeAsKey('entity')