| Conditions | 1 |
| Paths | 1 |
| Total Lines | 25 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function getConfigTreeBuilder() |
||
| 28 | { |
||
| 29 | $treeBuilder = new TreeBuilder(); |
||
| 30 | $rootNode = $treeBuilder->root($this->alias); |
||
| 31 | |||
| 32 | $supportedDrivers = ['mongodb', 'orm']; |
||
| 33 | |||
| 34 | $rootNode |
||
| 35 | ->children() |
||
| 36 | |||
| 37 | ->scalarNode('db_driver') |
||
| 38 | ->validate() |
||
| 39 | ->ifNotInArray($supportedDrivers) |
||
| 40 | ->thenInvalid('The database driver %s is not supported. Please choose one of ' . json_encode($supportedDrivers)) |
||
| 41 | ->end() |
||
| 42 | ->isRequired() |
||
| 43 | ->cannotBeOverwritten() |
||
| 44 | ->cannotBeEmpty() |
||
| 45 | ->end() |
||
| 46 | |||
| 47 | ->scalarNode('page_class')->isRequired()->cannotBeEmpty()->end() |
||
| 48 | ->end(); |
||
| 49 | |||
| 50 | return $treeBuilder; |
||
| 51 | } |
||
| 52 | } |
||
| 53 |