| Conditions | 1 |
| Paths | 1 |
| Total Lines | 47 |
| Code Lines | 42 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 41 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 5 | public function getConfigTreeBuilder() |
|
| 18 | { |
||
| 19 | 5 | $treeBuilder = new TreeBuilder; |
|
| 20 | 5 | $root = $treeBuilder->root('innmind_rest_client'); |
|
| 21 | |||
| 22 | $root |
||
| 23 | 5 | ->children() |
|
| 24 | 5 | ->arrayNode('types') |
|
| 25 | 5 | ->defaultValue([]) |
|
| 26 | 5 | ->prototype('scalar')->end() |
|
| 27 | 5 | ->end() |
|
| 28 | 5 | ->scalarNode('log_level') |
|
| 29 | 5 | ->info('Log level to be used to log all request sent') |
|
| 30 | 5 | ->validate() |
|
| 31 | 5 | ->ifNotInArray([ |
|
| 32 | 5 | LogLevel::EMERGENCY, |
|
| 33 | 5 | LogLevel::ALERT, |
|
| 34 | 5 | LogLevel::CRITICAL, |
|
| 35 | 5 | LogLevel::ERROR, |
|
| 36 | 5 | LogLevel::WARNING, |
|
| 37 | 5 | LogLevel::NOTICE, |
|
| 38 | 5 | LogLevel::INFO, |
|
| 39 | 5 | LogLevel::DEBUG, |
|
| 40 | ]) |
||
| 41 | 5 | ->thenInvalid('Invalid log level (check Psr\Log\LogLevel)') |
|
| 42 | 5 | ->end() |
|
| 43 | 5 | ->end() |
|
| 44 | 5 | ->scalarNode('cache_directory')->end() |
|
| 45 | 5 | ->arrayNode('content_type') |
|
| 46 | 5 | ->info('The list of formats you accept in the "Content-Type" response header') |
|
| 47 | 5 | ->useAttributeAsKey('name') |
|
| 48 | 5 | ->requiresAtLeastOneElement() |
|
| 49 | 5 | ->prototype('array') |
|
| 50 | 5 | ->children() |
|
| 51 | 5 | ->integerNode('priority')->end() |
|
| 52 | 5 | ->arrayNode('media_types') |
|
| 53 | 5 | ->useAttributeAsKey('name') |
|
| 54 | 5 | ->requiresAtLeastOneElement() |
|
| 55 | 5 | ->prototype('scalar')->end() |
|
| 56 | 5 | ->end() |
|
| 57 | 5 | ->end() |
|
| 58 | 5 | ->end() |
|
| 59 | 5 | ->end() |
|
| 60 | 5 | ->end(); |
|
| 61 | |||
| 62 | 5 | return $treeBuilder; |
|
| 63 | } |
||
| 64 | } |
||
| 65 |