File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 12
12
*/
13
13
class Configuration implements ConfigurationInterface
14
14
{
15
+ /** @var string */
16
+ protected $ alias ;
17
+
18
+ public function __construct ($ alias = 'gate_keeper ' )
19
+ {
20
+ $ this ->alias = $ alias ;
21
+ }
22
+
15
23
/**
16
24
* {@inheritDoc}
17
25
*/
18
26
public function getConfigTreeBuilder ()
19
27
{
20
- $ treeBuilder = new TreeBuilder ();
21
- /** @noinspection PhpUndefinedMethodInspection */
22
- $ treeBuilder ->root ('gate_keeper ' )
28
+ $ treeBuilder = new TreeBuilder ($ this ->alias );
29
+
30
+ $ rootNode = method_exists ($ treeBuilder , 'getRootNode ' ) ?
31
+ $ treeBuilder ->getRootNode ()
32
+ :
33
+ $ treeBuilder ->root ($ this ->alias ); // BC layer for symfony/config 4.1 and older
34
+
35
+ $ rootNode
23
36
->children ()
24
37
->scalarNode ('repository_service ' )
25
38
->defaultValue ('gatekeeper.repository.dummy ' )
26
39
->end ()
27
- ->scalarNode ('provider_service ' )
40
+ ->scalarNode ('provider_service ' )
28
41
->defaultValue ('gatekeeper.gates_provider.dummy ' )
29
42
->end ()
30
43
->end ();
You can’t perform that action at this time.
0 commit comments