Completed
Push — master ( a682ba...4851b3 )
by Paweł
40:50
created

Configuration::getConfigTreeBuilder()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 34
Code Lines 31

Duplication

Lines 34
Ratio 100 %

Code Coverage

Tests 31
CRAP Score 1

Importance

Changes 0
Metric Value
dl 34
loc 34
ccs 31
cts 31
cp 1
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 31
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Superdesk Web Publisher Menu Bundle.
7
 *
8
 * Copyright 2016 Sourcefabric z.ú. and contributors.
9
 *
10
 * For the full copyright and license information, please see the
11
 * AUTHORS and LICENSE files distributed with this source code.
12
 *
13
 * @copyright 2016 Sourcefabric z.ú
14
 * @license http://www.superdesk.org/license
15
 */
16
17
namespace SWP\Bundle\MenuBundle\DependencyInjection;
18
19
use SWP\Bundle\MenuBundle\Doctrine\ORM\MenuItemRepository;
20
use SWP\Bundle\MenuBundle\Factory\MenuFactory;
21
use SWP\Bundle\MenuBundle\Model\MenuItem;
22
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
23
use Symfony\Component\Config\Definition\ConfigurationInterface;
24
25
class Configuration implements ConfigurationInterface
26
{
27
    /**
28
     * {@inheritdoc}
29
     */
30 1 View Code Duplication
    public function getConfigTreeBuilder()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
31
    {
32 1
        $treeBuilder = new TreeBuilder();
33 1
        $treeBuilder->root('swp_menu')
34 1
            ->children()
35 1
                ->arrayNode('persistence')
36 1
                    ->addDefaultsIfNotSet()
37 1
                    ->children()
38 1
                        ->arrayNode('orm')
39 1
                            ->addDefaultsIfNotSet()
40 1
                            ->canBeEnabled()
41 1
                            ->children()
42 1
                                ->arrayNode('classes')
43 1
                                    ->addDefaultsIfNotSet()
44 1
                                    ->children()
45 1
                                        ->arrayNode('menu')
46 1
                                            ->addDefaultsIfNotSet()
47 1
                                            ->children()
48 1
                                                ->scalarNode('model')->cannotBeEmpty()->defaultValue(MenuItem::class)->end()
49 1
                                                ->scalarNode('repository')->defaultValue(MenuItemRepository::class)->end()
50 1
                                                ->scalarNode('factory')->defaultValue(MenuFactory::class)->end()
51 1
                                                ->scalarNode('object_manager_name')->defaultValue(null)->end()
52 1
                                            ->end()
53 1
                                        ->end()
54 1
                                    ->end()
55 1
                                ->end()
56 1
                            ->end()
57 1
                        ->end()
58 1
                    ->end()
59 1
                ->end()
60 1
            ->end();
61
62 1
        return $treeBuilder;
63
    }
64
}
65