Conditions | 1 |
Paths | 1 |
Total Lines | 48 |
Code Lines | 43 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | public function getConfigTreeBuilder(): TreeBuilder |
||
14 | { |
||
15 | $treeBuilder = new TreeBuilder('rbac'); |
||
16 | $rootNode = $treeBuilder->getRootNode(); |
||
17 | |||
18 | $rootNode |
||
19 | ->children() |
||
20 | ->arrayNode('database') |
||
21 | ->children() |
||
22 | ->enumNode('driver') |
||
23 | ->values(['pdo_mysql', 'pdo_postgres']) |
||
24 | ->isRequired() |
||
25 | ->end() |
||
26 | ->scalarNode('host') |
||
27 | ->cannotBeEmpty() |
||
28 | ->end() |
||
29 | ->scalarNode('user') |
||
30 | ->cannotBeEmpty() |
||
31 | ->end() |
||
32 | ->scalarNode('password') |
||
33 | ->cannotBeEmpty() |
||
34 | ->end() |
||
35 | ->integerNode('port') |
||
36 | ->isRequired() |
||
37 | ->end() |
||
38 | ->scalarNode('dbname') |
||
39 | ->cannotBeEmpty() |
||
40 | ->end() |
||
41 | ->scalarNode('charset') |
||
42 | ->cannotBeEmpty() |
||
43 | ->end() |
||
44 | ->end() |
||
45 | ->end() |
||
46 | ->arrayNode('userId') |
||
47 | ->children() |
||
48 | ->scalarNode('fieldName') |
||
49 | ->cannotBeEmpty() |
||
50 | ->end() |
||
51 | ->enumNode('resourceType') |
||
52 | ->values(['attribute', 'header', 'cookie']) |
||
53 | ->isRequired() |
||
54 | ->end() |
||
55 | ->end() |
||
56 | ->end() |
||
57 | ->end() |
||
58 | ; |
||
59 | |||
60 | return $treeBuilder; |
||
61 | } |
||
62 | } |