Completed
Pull Request — master (#9)
by methylbro
02:21
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 45
ccs 32
cts 32
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 38 1
1
<?php
2
3
/**
4
 * This file is part of the Mediapart Selligent Client API
5
 *
6
 * CC BY-NC-SA <https://github.com/mediapart/selligent>
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\Selligent;
13
14
use Symfony\Component\Config\Definition\ConfigurationInterface;
15
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
16
use Symfony\Component\Yaml\Yaml;
17
use Symfony\Component\Config\Definition\Processor;
18
19
use Psr\Log\LoggerInterface;
20
21
/**
22
 * Class Configuration
23
 * @package Mediapart\Selligent
24
 */
25
class Configuration implements ConfigurationInterface
26
{
27
    /**
28
     * Define configTree
29
     * @return TreeBuilder
30
     */
31 3
    public function getConfigTreeBuilder()
32
    { 
33 3
        $treeBuilder = new TreeBuilder();
34 3
        $rootNode = $treeBuilder->root('selligent');
35
36
        $rootNode
37 3
          ->children()
38 3
            ->scalarNode('login')
39 3
                ->isRequired()
40 3
                ->cannotBeEmpty()
41 3
            ->end()
42 3
            ->scalarNode('password')
43 3
              ->isRequired()
44 3
              ->cannotBeEmpty()
45 3
            ->end()
46 3
            ->scalarNode('namespace')
47 3
                ->defaultValue('http://tempuri.org/')
48 3
            ->end()
49 3
            ->scalarNode('wsdl')
50 3
              ->isRequired()
51 3
              ->cannotBeEmpty()
52 3
            ->end()
53 3
            ->scalarNode('list')
54 3
                ->isRequired()
55 3
            ->end()
56 3
            ->arrayNode('options')
57 3
                ->children()
58 3
                    ->arrayNode('classmap')
59 3
                        ->isRequired()
60 3
                        ->prototype('scalar')
61 3
                    ->end()
62 3
                ->end()
63 3
            ->end()
64 3
          ->end()
65
        ;
66
67 3
        return $treeBuilder;
68
    }
69
}
70