Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 30
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 16 1
1
<?php
2
3
/**
4
 * AnimeDb package.
5
 *
6
 * @author    Peter Gribanov <[email protected]>
7
 * @copyright Copyright (c) 2011, Peter Gribanov
8
 * @license   http://opensource.org/licenses/GPL-3.0 GPL v3
9
 */
10
11
namespace AnimeDb\Bundle\WorldArtBrowserBundle\DependencyInjection;
12
13
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
class Configuration implements ConfigurationInterface
18
{
19
    /**
20
     * Config tree builder.
21
     *
22
     * Example config:
23
     *
24
     * anime_db_world_art_browser:
25
     *     host: 'http://www.world-art.ru'
26
     *     client: 'My Custom Bot 1.0'
27
     *
28
     * @return ArrayNodeDefinition
29
     */
30 3
    public function getConfigTreeBuilder()
31
    {
32 3
        return (new TreeBuilder())
33 3
            ->root('anime_db_world_art_browser')
34 3
                ->children()
35 3
                    ->scalarNode('host')
36 3
                        ->defaultValue('http://www.world-art.ru')
37 3
                        ->cannotBeEmpty()
38 3
                    ->end()
39 3
                    ->scalarNode('client')
40 3
                        ->defaultValue('')
41 3
                    ->end()
42 3
                ->end()
43 3
            ->end()
44 3
        ;
45
    }
46
}
47