| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 2 | Features | 0 |
| 1 | <?php |
||
| 20 | public function getConfigTreeBuilder() |
||
| 21 | { |
||
| 22 | $treeBuilder = new TreeBuilder(); |
||
| 23 | $root = $treeBuilder->root('koff_i18n_form')->children(); |
||
| 24 | |||
| 25 | $locales = $root->arrayNode('locales'); |
||
| 26 | $locales->defaultValue(['en']); |
||
| 27 | $locales->beforeNormalization()->ifString()->then(function ($v) {return preg_split('/\s*[,|]\s*/', $v); }); |
||
| 28 | $locales->requiresAtLeastOneElement(); |
||
| 29 | $locales->prototype('scalar'); |
||
| 30 | |||
| 31 | $required = $root->arrayNode('required_locales'); |
||
| 32 | $required->beforeNormalization()->ifString()->then(function ($v) {return preg_split('/\s*[,|]\s*/', $v); }); |
||
| 33 | $required->prototype('scalar'); |
||
| 34 | |||
| 35 | $excluded = $root->arrayNode('excluded_fields'); |
||
| 36 | $excluded->defaultValue(['id', 'locale', 'translatable']); |
||
| 37 | $excluded->beforeNormalization()->ifString()->then(function ($v) {return preg_split('/\s*[,|]\s*/', $v); }); |
||
| 38 | $excluded->prototype('scalar'); |
||
| 39 | |||
| 40 | return $treeBuilder; |
||
| 41 | } |
||
| 43 |