| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 23 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 11 | public function getConfigTreeBuilder() | ||
| 12 |     { | ||
| 13 | $builder = new TreeBuilder(); | ||
| 14 |         $root    = $builder->root('calendr'); | ||
| 15 | |||
| 16 | $root | ||
| 17 | ->children() | ||
| 18 |                 ->arrayNode('periods') | ||
| 19 | ->addDefaultsIfNotSet() | ||
| 20 | ->children() | ||
| 21 |                         ->scalarNode('default_first_weekday') | ||
| 22 | ->defaultValue(Day::MONDAY) | ||
| 23 | ->validate() | ||
| 24 | ->ifNotInArray(range(DAY::SUNDAY, DAY::SATURDAY)) | ||
| 25 |                                 ->thenInvalid('Day must be be between 0 (Sunday) and 6 (Saturday)') | ||
| 26 | ->end() | ||
| 27 | ->end() | ||
| 28 | ->end() | ||
| 29 | ->end() | ||
| 30 | ->end(); | ||
| 31 | |||
| 32 | return $builder; | ||
| 33 | } | ||
| 34 | } | ||
| 35 |