Completed
Push — master ( 8dd935...0e2bba )
by Peter
04:33
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 24 1
1
<?php
2
/**
3
 * GpsLab component.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2016, Peter Gribanov
7
 * @license   http://opensource.org/licenses/MIT
8
 */
9
10
namespace GpsLab\Bundle\DomainEvent\DependencyInjection;
11
12
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
13
use Symfony\Component\Config\Definition\ConfigurationInterface;
14
15
class Configuration implements ConfigurationInterface
16
{
17
    /**
18
     * Config tree builder.
19
     *
20
     * Example config:
21
     *
22
     * gpslab_domain_event:
23
     *     bus: 'listener_located'
24
     *     queue: 'pull_memory'
25
     *     locator: 'symfony'
26
     *
27
     * @return TreeBuilder
28
     */
29 5
    public function getConfigTreeBuilder()
30
    {
31 5
        return (new TreeBuilder())
32 5
            ->root('gpslab_domain_event')
33 5
                ->children()
34 5
                    ->scalarNode('bus')
35 5
                        ->cannotBeEmpty()
36 5
                        ->defaultValue('listener_located')
37 5
                    ->end()
38 5
                    ->scalarNode('queue')
39 5
                        ->cannotBeEmpty()
40 5
                        ->defaultValue('pull_memory')
41 5
                    ->end()
42 5
                    ->scalarNode('locator')
43 5
                        ->cannotBeEmpty()
44 5
                        ->defaultValue('symfony')
45 5
                    ->end()
46 5
                    ->booleanNode('publish_on_flush')
47 5
                        ->defaultValue(false)
48 5
                    ->end()
49 5
                ->end()
50 5
            ->end()
51
        ;
52
    }
53
}
54