| Conditions | 2 |
| Paths | 2 |
| Total Lines | 40 |
| Code Lines | 33 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function getConfigTreeBuilder() |
||
| 24 | { |
||
| 25 | $treeBuilder = new TreeBuilder(); |
||
| 26 | $root = $treeBuilder->root('elao_api_resources_metadata'); |
||
| 27 | |||
| 28 | $root |
||
| 29 | ->children() |
||
| 30 | ->booleanNode('nelmio_api_doc')->defaultValue(class_exists(NelmioApiDocBundle::class))->end() |
||
| 31 | ->scalarNode('cache')->info('true, false or cache service id')->end() |
||
| 32 | // loaders |
||
| 33 | ->arrayNode('loaders') |
||
| 34 | ->addDefaultsIfNotSet() |
||
| 35 | ->children() |
||
| 36 | ->arrayNode('yaml') |
||
| 37 | ->canBeDisabled() |
||
| 38 | ->children() |
||
| 39 | ->scalarNode('path') |
||
| 40 | ->defaultValue('%kernel.root_dir%/Resources/api_resources_metadata.yml') |
||
| 41 | ->end() |
||
| 42 | ->end() |
||
| 43 | ->end() |
||
| 44 | ->arrayNode('property_info') |
||
| 45 | ->{class_exists(PropertyInfo\Type::class) ? 'canBeDisabled' : 'canBeEnabled'}() |
||
| 46 | ->children() |
||
| 47 | ->scalarNode('service') |
||
| 48 | ->defaultValue('elao.api_resources_metadata.property_info') |
||
| 49 | ->end() |
||
| 50 | ->end() |
||
| 51 | ->end() |
||
| 52 | ->end() |
||
| 53 | ->end() |
||
| 54 | // resources for array locator |
||
| 55 | ->arrayNode('resources') |
||
| 56 | ->useAttributeAsKey('shortName')->prototype('scalar')->end() |
||
| 57 | ->end() |
||
| 58 | ->end() |
||
| 59 | ; |
||
| 60 | |||
| 61 | return $treeBuilder; |
||
| 62 | } |
||
| 63 | } |
||
| 64 |