Configuration::getConfigTreeBuilder()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 34
Code Lines 28

Duplication

Lines 0
Ratio 0 %

Importance

Changes 7
Bugs 0 Features 1
Metric Value
c 7
b 0
f 1
dl 0
loc 34
rs 8.8571
cc 1
eloc 28
nc 1
nop 0
1
<?php
2
3
namespace Ob\CmsBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * This is the class that validates and merges configuration from your app/config files
10
 *
11
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
12
 */
13
class Configuration implements ConfigurationInterface
14
{
15
    /**
16
     * {@inheritDoc}
17
     */
18
    public function getConfigTreeBuilder()
19
    {
20
        $treeBuilder = new TreeBuilder();
21
        $rootNode    = $treeBuilder->root('ob_cms');
22
23
        $rootNode
24
            ->children()
25
                ->arrayNode('locales')->defaultValue(array('%locale%'))->prototype('scalar')->end()->end()
26
                ->scalarNode('logo')->defaultValue('http://placehold.it/400x65')->end()
27
28
                ->arrayNode('classes')
29
                    ->addDefaultsIfNotSet()
30
                    ->children()
31
                        ->scalarNode('controller')->defaultValue('Ob\CmsBundle\Controller\AdminController')->end()
32
                    ->end()
33
                ->end()
34
35
                ->arrayNode('templates')
36
                    ->addDefaultsIfNotSet()
37
                    ->children()
38
                        ->scalarNode('layout')->defaultValue('ObCmsBundle::layout.html.twig')->end()
39
                        ->scalarNode('menu')->defaultValue('ObCmsBundle:Menu:menu.html.twig')->end()
40
                        ->scalarNode('dashboard')->defaultValue('ObCmsBundle:Admin:dashboard.html.twig')->end()
41
                        ->scalarNode('list')->defaultValue('ObCmsBundle:CRUD:list.html.twig')->end()
42
                        ->scalarNode('new')->defaultValue('ObCmsBundle:CRUD:new.html.twig')->end()
43
                        ->scalarNode('edit')->defaultValue('ObCmsBundle:CRUD:edit.html.twig')->end()
44
                        ->scalarNode('table')->defaultValue('ObCmsBundle:Table:table.html.twig')->end()
45
                        ->scalarNode('fields')->defaultValue('MopaBootstrapBundle:Form:fields.html.twig')->end()
46
                    ->end()
47
                ->end()
48
            ->end();
49
50
        return $treeBuilder;
51
    }
52
}
53