Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 59
ccs 50
cts 50
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 54 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
final class Configuration implements ConfigurationInterface
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17 48
    public function getConfigTreeBuilder()
18
    {
19 48
        $treeBuilder = new TreeBuilder;
20 48
        $root = $treeBuilder->root('innmind_neo4j');
21
22
        $root
23 48
            ->children()
24 48
                ->arrayNode('connection')
25 48
                    ->addDefaultsIfNotSet()
26 48
                    ->children()
27 48
                        ->scalarNode('host')
28 48
                            ->defaultValue('localhost')
29 48
                        ->end()
30 48
                        ->scalarNode('scheme')
31 48
                            ->defaultValue('https')
32 48
                        ->end()
33 48
                        ->integerNode('port')
34 48
                            ->defaultValue(7474)
35 48
                        ->end()
36 48
                        ->scalarNode('user')
37 48
                            ->defaultValue('neo4j')
38 48
                        ->end()
39 48
                        ->scalarNode('password')
40 48
                            ->defaultValue('neo4j')
41 48
                        ->end()
42 48
                    ->end()
43 48
                ->end()
44 48
                ->arrayNode('types')
45 48
                    ->defaultValue([])
46 48
                    ->prototype('scalar')->end()
47 48
                ->end()
48 48
                ->scalarNode('persister')
49 48
                    ->info('The service name to use in the unit of work to persist the entity container')
50 48
                    ->defaultValue('innmind_neo4j.persister.delegation')
51 48
                ->end()
52 48
                ->scalarNode('metadata_configuration')
53 48
                    ->info('The service to use to validate a metadata configuration')
54 48
                    ->defaultValue('innmind_neo4j.metadata_builder.configuration')
55 48
                ->end()
56 48
                ->scalarNode('clock')
57 48
                    ->info('The clock service to use (instance of TimeContinuumInterface)')
58 48
                    ->defaultValue('innmind_neo4j.clock')
59 48
                ->end()
60 48
                ->scalarNode('event_bus')
61 48
                    ->info('The event bus service to use for persisters')
62 48
                    ->defaultValue('innmind_neo4j.event_bus.null')
63 48
                ->end()
64 48
                ->scalarNode('dbal_connection')
65 48
                    ->info('The dbal connection service to use')
66 48
                    ->defaultValue('innmind_neo4j.dbal.connection.logger')
67 48
                ->end()
68 48
            ->end();
69
70 48
        return $treeBuilder;
71
    }
72
}
73