1 | <?php |
||
2 | namespace Yoanm\SymfonyJsonRpcHttpServerDoc\DependencyInjection; |
||
3 | |||
4 | use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
||
5 | use Symfony\Component\Config\Definition\ConfigurationInterface; |
||
6 | |||
7 | /** |
||
8 | * Class Configuration |
||
9 | */ |
||
10 | class Configuration implements ConfigurationInterface |
||
11 | { |
||
12 | const DEFAULT_ENDPOINT = '/doc'; |
||
13 | /** |
||
14 | * {@inheritdoc} |
||
15 | */ |
||
16 | 1 | public function getConfigTreeBuilder() |
|
17 | { |
||
18 | 1 | $treeBuilder = new TreeBuilder(); |
|
19 | |||
20 | 1 | $rootNode = $treeBuilder->root(JsonRpcHttpServerDocExtension::EXTENSION_IDENTIFIER); |
|
21 | |||
22 | $rootNode |
||
23 | 1 | ->addDefaultsIfNotSet() |
|
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
24 | 1 | ->children() |
|
25 | 1 | ->variableNode('endpoint') |
|
26 | 1 | ->info('Your custom http doc endpoint path') |
|
27 | 1 | ->treatNullLike(self::DEFAULT_ENDPOINT) |
|
28 | 1 | ->defaultValue(self::DEFAULT_ENDPOINT) |
|
29 | 1 | ->end() |
|
30 | 1 | ->end() |
|
31 | ; |
||
32 | |||
33 | 1 | return $treeBuilder; |
|
34 | } |
||
35 | } |
||
36 |