| Conditions | 1 |
| Paths | 1 |
| Total Lines | 36 |
| Code Lines | 31 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 30 |
| CRAP Score | 1 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | 3 | public function getConfigTreeBuilder() |
|
| 17 | { |
||
| 18 | 3 | $treeBuilder = new TreeBuilder(); |
|
| 19 | 3 | $rootNode = $treeBuilder->root('zenstruck_object_routing'); |
|
| 20 | |||
| 21 | $rootNode |
||
| 22 | 3 | ->children() |
|
| 23 | 3 | ->arrayNode('class_map') |
|
| 24 | 3 | ->useAttributeAsKey('class') |
|
| 25 | 3 | ->prototype('array') |
|
| 26 | 3 | ->children() |
|
| 27 | 3 | ->scalarNode('default_route') |
|
| 28 | 3 | ->defaultNull() |
|
| 29 | 3 | ->info('Optional - The route to use when an object is passed as the 1st parameter of Router::generate()') |
|
| 30 | 3 | ->end() |
|
| 31 | 3 | ->arrayNode('default_parameters') |
|
| 32 | 3 | ->info('Route parameter as key, object method/public property as value (can omit key if object method/property is the same)') |
|
| 33 | 3 | ->example(array('id', 'path')) |
|
| 34 | 3 | ->prototype('scalar')->end() |
|
| 35 | 3 | ->end() |
|
| 36 | 3 | ->arrayNode('routes') |
|
| 37 | 3 | ->info('Route name as key, parameter array as value (can leave parameter array as null if same as default_parameters)') |
|
| 38 | 3 | ->example(array('blog_show' => '~', 'blog_edit' => array('id'))) |
|
| 39 | 3 | ->useAttributeAsKey('route_name') |
|
| 40 | 3 | ->prototype('array') |
|
| 41 | 3 | ->prototype('scalar')->end() |
|
| 42 | 3 | ->end() |
|
| 43 | 3 | ->end() |
|
| 44 | 3 | ->end() |
|
| 45 | 3 | ->end() |
|
| 46 | 3 | ->end() |
|
| 47 | 3 | ->end() |
|
| 48 | ; |
||
| 49 | |||
| 50 | 3 | return $treeBuilder; |
|
| 51 | } |
||
| 52 | } |
||
| 53 |