Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 38 1
1
<?php
2
3
namespace Mukhin\PrivatbankBundle\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/configuration.html}
12
 */
13
class Configuration implements ConfigurationInterface
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function getConfigTreeBuilder()
19
    {
20
        $treeBuilder = new TreeBuilder();
21
        $rootNode = $treeBuilder->root('mukhin_privatbank');
22
        $rootNode
23
            ->fixXmlConfig('merchant')
24
            ->children()
25
                ->arrayNode('merchants')
26
                    ->useAttributeAsKey('name')
27
                    ->prototype('array')
28
                        ->children()
29
                            ->scalarNode('merchant_id')
30
                                ->info('Merchant ID')
31
                                ->isRequired()
32
                                ->cannotBeEmpty()
33
                            ->end()
34
                            ->scalarNode('merchant_secret')
35
                                ->info('Merchant Secret')
36
                                ->isRequired()
37
                                ->cannotBeEmpty()
38
                            ->end()
39
                            ->scalarNode('card_number')
40
                                ->info('Card number associated with given Merchant')
41
                                ->isRequired()
42
                                ->cannotBeEmpty()
43
                            ->end()
44
                        ->end()
45
                    ->end()
46
                ->end()
47
            ->end()
48
            ;
49
50
        // Here you should define the parameters that are allowed to
51
        // configure your bundle. See the documentation linked above for
52
        // more information on that topic.
53
54
        return $treeBuilder;
55
    }
56
}
57