jin2chen /
api-bundle
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace jin2chen\ApiBundle\DependencyInjection; |
||
| 6 | |||
| 7 | use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
||
| 8 | use Symfony\Component\Config\Definition\ConfigurationInterface; |
||
| 9 | |||
| 10 | class Configuration implements ConfigurationInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @inheritdoc |
||
| 14 | * @psalm-suppress all |
||
| 15 | */ |
||
| 16 | 1 | public function getConfigTreeBuilder(): TreeBuilder |
|
| 17 | { |
||
| 18 | 1 | $treeBuilder = new TreeBuilder('jin2chen_api'); |
|
| 19 | 1 | $rootNode = $treeBuilder->getRootNode(); |
|
| 20 | |||
| 21 | // @formatter:off |
||
| 22 | $rootNode |
||
| 23 | 1 | ->addDefaultsIfNotSet() |
|
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 24 | 1 | ->children() |
|
| 25 | 1 | ->arrayNode('request') |
|
| 26 | 1 | ->addDefaultsIfNotSet() |
|
| 27 | 1 | ->children() |
|
| 28 | 1 | ->scalarNode('request_id_header') |
|
| 29 | 1 | ->defaultValue('X-Request-id') |
|
| 30 | 1 | ->end() |
|
| 31 | 1 | ->end() |
|
| 32 | 1 | ->end() |
|
| 33 | 1 | ->arrayNode('response') |
|
| 34 | 1 | ->addDefaultsIfNotSet() |
|
| 35 | 1 | ->children() |
|
| 36 | 1 | ->arrayNode('exception_converters') |
|
| 37 | 1 | ->useAttributeAsKey('exception')->scalarPrototype()->end() |
|
| 38 | 1 | ->end() |
|
| 39 | 1 | ->end() |
|
| 40 | 1 | ->end() |
|
| 41 | 1 | ->end(); |
|
| 42 | // @formatter:on |
||
| 43 | |||
| 44 | 1 | return $treeBuilder; |
|
| 45 | } |
||
| 46 | } |
||
| 47 |