Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 14
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 19
ccs 14
cts 14
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 15
nc 1
nop 0
crap 1
1
<?php
2
3
namespace EmanueleMinotto\DomainParserBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * {@inheritdoc}
10
 */
11
class Configuration implements ConfigurationInterface
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 3
    public function getConfigTreeBuilder()
17
    {
18 3
        $treeBuilder = new TreeBuilder();
19 3
        $rootNode = $treeBuilder->root('domain_parser');
20
21
        $rootNode
22 3
            ->children()
23 3
                ->scalarNode('cache_dir')
24 3
                    ->defaultNull()
25 3
                    ->info('Directory where text and php versions of list will be cached')
26 3
                ->end()
27 3
                ->scalarNode('http_adapter')
28 3
                    ->defaultNull()
29 3
                    ->info('HTTP adapter (must implement \Pdp\HttpAdapter\HttpAdapterInterface)')
30 3
                ->end()
31 3
            ->end();
32
33 3
        return $treeBuilder;
34
    }
35
}
36