Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Commit 7076c1f

Browse files
snebesgilles-g
authored andcommitted
Update Configuration for Symfony deprecation (#309)
* config update * namespaced method
1 parent e181f0b commit 7076c1f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

DependencyInjection/Configuration.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ class Configuration implements ConfigurationInterface
2020
*/
2121
public function getConfigTreeBuilder()
2222
{
23-
$treeBuilder = new TreeBuilder();
23+
$treeBuilder = new TreeBuilder('lexik_form_filter');
24+
25+
if (\method_exists($treeBuilder, 'getRootNode')) {
26+
$rootNode = $treeBuilder->getRootNode();
27+
} else {
28+
// BC layer for symfony/config 4.1 and older
29+
$rootNode = $treeBuilder->root('lexik_form_filter');
30+
}
2431

25-
$rootNode = $treeBuilder->root('lexik_form_filter');
2632
$rootNode
2733
->children()
2834
->arrayNode('listeners')

0 commit comments

Comments
 (0)