| Conditions | 3 |
| Paths | 1 |
| Total Lines | 34 |
| Code Lines | 29 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 16 | ||
| Bugs | 5 | Features | 1 |
| 1 | <?php |
||
| 32 | public function getConfigTreeBuilder() |
||
| 33 | { |
||
| 34 | $treeBuilder = new TreeBuilder(); |
||
| 35 | $rootNode = $treeBuilder->root($this->alias); |
||
| 36 | |||
| 37 | $rootNode |
||
| 38 | ->children() |
||
| 39 | ->scalarNode('server_name')->cannotBeEmpty()->defaultValue('OAuth2 Server')->end() |
||
| 40 | ->arrayNode('compression_methods')->prototype('scalar')->end()->treatNullLike([])->end() |
||
| 41 | ->arrayNode('storage') |
||
| 42 | ->addDefaultsIfNotSet() |
||
| 43 | ->validate() |
||
| 44 | ->ifTrue(function ($value) { |
||
| 45 | return true === $value['enabled'] && null !== $value['class'] && !class_exists($value['class']); |
||
| 46 | }) |
||
| 47 | ->thenInvalid('The class does not exist') |
||
| 48 | ->end() |
||
| 49 | ->children() |
||
| 50 | ->booleanNode('enabled') |
||
| 51 | ->defaultFalse() |
||
| 52 | ->end() |
||
| 53 | ->scalarNode('manager') |
||
| 54 | ->defaultValue('jose.jot_manager.default') |
||
| 55 | ->cannotBeEmpty() |
||
| 56 | ->end() |
||
| 57 | ->scalarNode('class') |
||
| 58 | ->defaultNull() |
||
| 59 | ->end() |
||
| 60 | ->end() |
||
| 61 | ->end() |
||
| 62 | ->end(); |
||
| 63 | |||
| 64 | return $treeBuilder; |
||
| 65 | } |
||
| 66 | } |
||
| 67 |