root('kimai'); $rootNode ->children() ->arrayNode('timesheet') ->children() ->booleanNode('duration_only') ->defaultValue(false) ->end() ->arrayNode('rounding') ->requiresAtLeastOneElement() ->useAttributeAsKey('key') ->arrayPrototype() ->children() ->arrayNode('days') ->requiresAtLeastOneElement() ->useAttributeAsKey('key') ->isRequired() ->prototype('scalar')->end() ->defaultValue([]) ->end() ->integerNode('begin') ->defaultValue(0) ->end() ->integerNode('end') ->defaultValue(0) ->end() ->integerNode('duration') ->defaultValue(0) ->end() ->end() ->end() ->defaultValue([]) ->end() ->arrayNode('rates') ->requiresAtLeastOneElement() ->useAttributeAsKey('key') ->arrayPrototype() ->children() ->arrayNode('days') ->requiresAtLeastOneElement() ->useAttributeAsKey('key') ->isRequired() ->prototype('scalar')->end() ->defaultValue([]) ->end() ->floatNode('factor') ->isRequired() ->defaultValue(1) ->end() ->end() ->end() ->defaultValue([]) ->end() ->end() ->end() ->arrayNode('invoice') ->children() ->arrayNode('renderer') ->requiresAtLeastOneElement() ->useAttributeAsKey('key') ->isRequired() ->prototype('scalar')->end() ->defaultValue([ 'default' => 'App\Controller\InvoiceController::invoiceAction', ]) ->end() ->arrayNode('calculator') ->requiresAtLeastOneElement() ->useAttributeAsKey('key') ->isRequired() ->prototype('scalar')->end() ->defaultValue([ 'default' => 'App\Invoice\DefaultCalculator', ]) ->end() ->arrayNode('number_generator') ->requiresAtLeastOneElement() ->useAttributeAsKey('key') ->isRequired() ->prototype('scalar')->end() ->defaultValue([ 'default' => 'App\Invoice\DateNumberGenerator', ]) ->end() ->end() ->end() ->arrayNode('languages') ->arrayPrototype() ->children() ->scalarNode('date_short')->end() ->end() ->end() ->end() ->end() ->end(); return $treeBuilder; } }