Conditions | 1 |
Paths | 1 |
Total Lines | 40 |
Code Lines | 36 |
Lines | 0 |
Ratio | 0 % |
Tests | 35 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | 3 | public function getConfigTreeBuilder() |
|
17 | { |
||
18 | 3 | $treeBuilder = new TreeBuilder(); |
|
19 | 3 | $rootNode = $treeBuilder->root('safe_browsing'); |
|
20 | |||
21 | $rootNode |
||
22 | 3 | ->children() |
|
23 | 3 | ->arrayNode('configs') |
|
24 | 3 | ->children() |
|
25 | 3 | ->scalarNode('client') |
|
26 | 3 | ->defaultValue('app') |
|
27 | 3 | ->info('The client name') |
|
28 | 3 | ->end() |
|
29 | 3 | ->scalarNode('appver') |
|
30 | 3 | ->defaultValue('1.0.0') |
|
31 | 3 | ->info('The version of the client') |
|
32 | 3 | ->end() |
|
33 | 3 | ->scalarNode('key') |
|
34 | 3 | ->info('API key') |
|
35 | 3 | ->isRequired() |
|
36 | 3 | ->end() |
|
37 | 3 | ->enumNode('pver') |
|
38 | 3 | ->defaultValue(3.1) |
|
39 | 3 | ->info('The protocol version supported') |
|
40 | 3 | ->values([3.0, 3.1]) |
|
41 | 3 | ->end() |
|
42 | 3 | ->end() |
|
43 | 3 | ->end() |
|
44 | 3 | ->scalarNode('cache') |
|
45 | 3 | ->defaultNull() |
|
46 | 3 | ->info('Caching service') |
|
47 | 3 | ->end() |
|
48 | 3 | ->scalarNode('http_client') |
|
49 | 3 | ->defaultNull() |
|
50 | 3 | ->info('HTTP client service') |
|
51 | 3 | ->end() |
|
52 | 3 | ->end(); |
|
53 | |||
54 | 3 | return $treeBuilder; |
|
55 | } |
||
56 | } |
||
57 |