Completed
Push — master ( e8b056...1f0b59 )
by Christian
06:37
created

Configuration::addHttpClientSection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 14
rs 9.4285
cc 1
eloc 11
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the ni-ju-san CMS.
5
 *
6
 * (c) Christian Gripp <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Core23\PiwikBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
15
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
16
use Symfony\Component\Config\Definition\ConfigurationInterface;
17
18
class Configuration implements ConfigurationInterface
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function getConfigTreeBuilder()
24
    {
25
        $treeBuilder = new TreeBuilder();
26
        $node = $treeBuilder->root('core23_piwik');
27
28
        $this->addHttpClientSection($node);
29
30
        return $treeBuilder;
31
    }
32
33
    /**
34
     * @param ArrayNodeDefinition $node
35
     */
36
    private function addHttpClientSection(ArrayNodeDefinition $node)
37
    {
38
        $node
39
            ->children()
40
                ->arrayNode('http')
41
                    ->addDefaultsIfNotSet()
42
                    ->children()
43
                        ->scalarNode('client')->defaultValue('httplug.client.default')->end()
44
                        ->scalarNode('message_factory')->defaultValue('httplug.message_factory.default')->end()
45
                    ->end()
46
                ->end()
47
            ->end()
48
        ;
49
    }
50
}
51