Configuration::getConfigTreeBuilder()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 36
Code Lines 30

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 30
nc 1
nop 0
dl 0
loc 36
rs 8.8571
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of the Mediapart LaPresseLibre Bundle.
5
 *
6
 * CC BY-NC-SA <https://github.com/mediapart/lapresselibre-bundle>
7
 *
8
 * For the full license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Mediapart\Bundle\LaPresseLibreBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
/**
18
 * This is the class that validates and merges configuration from your app/config files
19
 *
20
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
21
 */
22
class Configuration implements ConfigurationInterface
23
{
24
    /**
25
     * {@inheritDoc}
26
     */
27
    public function getConfigTreeBuilder()
28
    {
29
        $treeBuilder = new TreeBuilder();
30
        $rootNode = $treeBuilder->root('mediapart_la_presse_libre');
31
32
        $rootNode
33
            ->children()
34
                ->scalarNode('public_key')
35
                    ->defaultValue('%lapresselibre_publickey%')
36
                    ->cannotBeEmpty()
37
                ->end()
38
                ->scalarNode('secret_key')
39
                    ->defaultValue('%lapresselibre_secretkey%')
40
                    ->cannotBeEmpty()
41
                ->end()
42
                ->scalarNode('aes_password')
43
                    ->defaultValue('%lapresselibre_aespassword%')
44
                    ->cannotBeEmpty()
45
                ->end()
46
                ->scalarNode('aes_iv')
47
                    ->defaultValue('%lapresselibre_aesiv%')
48
                ->end()
49
                ->scalarNode('aes_options')
50
                    ->defaultValue(OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING)
51
                ->end()
52
                ->arrayNode('account')
53
                    ->children()
54
                        ->scalarNode('repository')->end()
55
                        ->scalarNode('provider')->end()
56
                    ->end()
57
                ->end()
58
59
            ->end()
60
        ;
61
62
        return $treeBuilder;
63
    }
64
}
65