Completed
Push — develop ( 7f6ad2...eb155e )
by Baptiste
02:38
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 46 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Neo4jBundle\DependencyInjection;
5
6
use Symfony\Component\Config\Definition\{
7
    Builder\TreeBuilder,
8
    Builder\NodeBuilder,
9
    ConfigurationInterface
10
};
11
12
class Configuration implements ConfigurationInterface
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function getConfigTreeBuilder()
18
    {
19
        $treeBuilder = new TreeBuilder;
20
        $root = $treeBuilder->root('innmind_neo4j');
21
22
        $root
23
            ->children()
24
                ->arrayNode('connection')
25
                    ->addDefaultsIfNotSet()
26
                    ->children()
27
                        ->scalarNode('host')
28
                            ->defaultValue('localhost')
29
                        ->end()
30
                        ->scalarNode('scheme')
31
                            ->defaultValue('https')
32
                        ->end()
33
                        ->integerNode('port')
34
                            ->defaultValue(7474)
35
                        ->end()
36
                        ->scalarNode('user')
37
                            ->defaultValue('neo4j')
38
                        ->end()
39
                        ->scalarNode('password')
40
                            ->defaultValue('neo4j')
41
                        ->end()
42
                        ->integerNode('timeout')
43
                            ->defaultValue(60)
44
                        ->end()
45
                    ->end()
46
                ->end()
47
                ->arrayNode('types')
48
                    ->defaultValue([])
49
                    ->prototype('scalar')->end()
50
                ->end()
51
                ->scalarNode('persister')
52
                    ->info('The service name to use in the unit of work to persist the entity container')
53
                    ->defaultValue('innmind_neo4j.persister.delegation')
54
                ->end()
55
                ->scalarNode('metadata_configuration')
56
                    ->info('The service to use to validate a metadata configuration')
57
                    ->defaultValue('innmind_neo4j.metadata_builder.configuration')
58
                ->end()
59
            ->end();
60
61
        return $treeBuilder;
62
    }
63
}
64