Completed
Push — master ( 586166...fecb59 )
by Paweł
47:58
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 40
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 40
ccs 31
cts 31
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 34 1
1
<?php
2
3
/**
4
 * This file is part of the Superdesk Web Publisher Content Bundle.
5
 *
6
 * Copyright 2016 Sourcefabric z.ú. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2016 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Bundle\RuleBundle\DependencyInjection;
16
17
use SWP\Bundle\RuleBundle\Doctrine\ORM\RuleRepository;
18
use SWP\Component\Rule\Model\Rule;
19
use SWP\Component\Storage\Factory\Factory;
20
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
21
use Symfony\Component\Config\Definition\ConfigurationInterface;
22
23
class Configuration implements ConfigurationInterface
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28 1
    public function getConfigTreeBuilder()
29
    {
30 1
        $treeBuilder = new TreeBuilder();
31 1
        $treeBuilder->root('swp_rule')
32 1
            ->children()
33 1
                ->arrayNode('persistence')
34 1
                    ->addDefaultsIfNotSet()
35 1
                    ->children()
36 1
                        ->arrayNode('orm')
37 1
                            ->addDefaultsIfNotSet()
38 1
                            ->canBeEnabled()
39 1
                            ->children()
40 1
                                ->arrayNode('classes')
41 1
                                    ->addDefaultsIfNotSet()
42 1
                                    ->children()
43 1
                                        ->arrayNode('rule')
44 1
                                            ->addDefaultsIfNotSet()
45 1
                                            ->children()
46 1
                                                ->scalarNode('model')->cannotBeEmpty()->defaultValue(Rule::class)->end()
47 1
                                                ->scalarNode('repository')->defaultValue(RuleRepository::class)->end()
48 1
                                                ->scalarNode('factory')->defaultValue(Factory::class)->end()
49 1
                                                ->scalarNode('object_manager_name')->defaultValue(null)->end()
50 1
                                            ->end()
51 1
                                        ->end()
52 1
                                    ->end()
53 1
                                ->end()
54 1
                            ->end()
55 1
                        ->end()
56 1
                    ->end()
57 1
                ->end()
58 1
            ->end();
59
60 1
        return $treeBuilder;
61
    }
62
}
63