Completed
Push — master ( 568e7c...33842a )
by Baptiste
02:25
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 1
c 2
b 0
f 2
lcom 0
cbo 3
dl 0
loc 57
ccs 46
cts 46
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 51 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 44
    public function getConfigTreeBuilder()
18
    {
19 44
        $treeBuilder = new TreeBuilder;
20 44
        $root = $treeBuilder->root('innmind_neo4j');
21
22
        $root
23 44
            ->children()
24 44
                ->arrayNode('connection')
25 44
                    ->addDefaultsIfNotSet()
26 44
                    ->children()
27 44
                        ->scalarNode('host')
28 44
                            ->defaultValue('localhost')
29 44
                        ->end()
30 44
                        ->scalarNode('scheme')
31 44
                            ->defaultValue('https')
32 44
                        ->end()
33 44
                        ->integerNode('port')
34 44
                            ->defaultValue(7474)
35 44
                        ->end()
36 44
                        ->scalarNode('user')
37 44
                            ->defaultValue('neo4j')
38 44
                        ->end()
39 44
                        ->scalarNode('password')
40 44
                            ->defaultValue('neo4j')
41 44
                        ->end()
42 44
                        ->integerNode('timeout')
43 44
                            ->defaultValue(60)
44 44
                        ->end()
45 44
                    ->end()
46 44
                ->end()
47 44
                ->arrayNode('types')
48 44
                    ->defaultValue([])
49 44
                    ->prototype('scalar')->end()
50 44
                ->end()
51 44
                ->arrayNode('identity_generators')
52 44
                    ->info('Identity generators, with keys as identity classes and values as generator service name')
53 44
                    ->defaultValue([])
54 44
                    ->prototype('scalar')->end()
55 44
                ->end()
56 44
                ->scalarNode('persister')
57 44
                    ->info('The service name to use in the unit of work to persist the entity container')
58 44
                    ->defaultValue('innmind_neo4j.persister.delegation')
59 44
                ->end()
60 44
                ->scalarNode('metadata_configuration')
61 44
                    ->info('The service to use to validate a metadata configuration')
62 44
                    ->defaultValue('innmind_neo4j.metadata_builder.configuration')
63 44
                ->end()
64 44
            ->end();
65
66 44
        return $treeBuilder;
67
    }
68
}
69