Completed
Push — master ( c80d7c...01f162 )
by Colin
05:28
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 86.96%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 31
ccs 20
cts 23
cp 0.8696
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 25 1
1
<?php
2
3
/*
4
 * This file is part of the colinodell\omnipay-bundle package.
5
 *
6
 * (c) 2018 Colin O'Dell <[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 ColinODell\OmnipayBundle\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 22
    public function getConfigTreeBuilder()
28
    {
29 22
        $treeBuilder = new TreeBuilder();
30 22
        $rootNode = $treeBuilder->root('omnipay');
31
32
        $rootNode
33 22
            ->children()
34 22
                ->arrayNode('methods')
35 22
                    ->useAttributeAsKey('name')
36 22
                    ->prototype('variable')
37 22
                    ->end()
38 22
                ->end()
39 22
                ->scalarNode('default_gateway')
40 22
                    ->defaultNull()
41 22
                ->end()
42 22
                ->booleanNode('initialize_gateway_on_registration')
43 22
                    ->defaultFalse()
44 22
                ->end()
45 22
                ->arrayNode('disabled_gateways')
46 22
                    ->prototype('scalar')
47 22
                ->end()
48 22
            ->end();
49
50 22
        return $treeBuilder;
51
    }
52
}
53