Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 42
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 36 1
1
<?php
2
3
namespace Fenrizbes\PublicationsBundle\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('fenrizbes_publications');
22
23
        $rootNode
24
            ->children()
25
                ->scalarNode('date_format')
26
                    ->cannotBeEmpty()
27
                    ->defaultValue('F d, Y')
28
                ->end()
29
30
                ->scalarNode('datetime_format')
31
                    ->cannotBeEmpty()
32
                    ->defaultValue('F d, Y H:i')
33
                ->end()
34
35
                ->arrayNode('sonata_admin')
36
                    ->addDefaultsIfNotSet()
37
38
                    ->children()
39
                        ->scalarNode('group_label')
40
                            ->cannotBeEmpty()
41
                            ->defaultValue('fp.label.admin')
42
                        ->end()
43
44
                        ->scalarNode('content_editor')
45
                            ->defaultNull()
46
                        ->end()
47
                    ->end()
48
                ->end()
49
            ->end()
50
        ;
51
52
        return $treeBuilder;
53
    }
54
}
55