| Conditions | 1 |
| Paths | 1 |
| Total Lines | 33 |
| Code Lines | 29 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 31 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 39 | 1 | public function getConfigTreeBuilder() |
|
| 40 | 1 | { |
|
| 41 | 1 | $treeBuilder = new TreeBuilder(); |
|
| 42 | 1 | $rootNode = $treeBuilder->root($this->alias); |
|
| 43 | 1 | $rootNode->children() |
|
| 44 | 1 | ->arrayNode('drivers') |
|
| 45 | 1 | ->prototype('array') |
|
| 46 | 1 | ->children() |
|
| 47 | 1 | ->scalarNode('connection') |
|
| 48 | 1 | ->cannotBeEmpty() |
|
| 49 | 1 | ->isRequired() |
|
| 50 | 1 | ->defaultValue('default') |
|
| 51 | 1 | ->end() |
|
| 52 | 1 | ->scalarNode('serializer') |
|
| 53 | 1 | ->cannotBeEmpty() |
|
| 54 | 1 | ->isRequired() |
|
| 55 | 1 | ->validate() |
|
| 56 | 1 | ->ifTrue(function($v) { |
|
| 57 | 1 | return strpos($v, '@') !== 0; |
|
| 58 | 1 | }) |
|
| 59 | 1 | ->thenInvalid('Serializer has to be in form "@service.id"') |
|
| 60 | 1 | ->end() |
|
| 61 | 1 | ->end() |
|
| 62 | 1 | ->scalarNode('table_name') |
|
| 63 | 1 | ->defaultValue('cmq') |
|
| 64 | 1 | ->end() |
|
| 65 | 1 | ->end() |
|
| 66 | 1 | ->end() |
|
| 67 | 1 | ->end() |
|
| 68 | 1 | ->end(); |
|
| 69 | |||
| 70 | 1 | return $treeBuilder; |
|
| 71 | } |
||
| 72 | } |
||
| 73 |