Completed
Pull Request — develop (#161)
by Wachter
15:19
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 50 1
1
<?php
2
3
/*
4
 * This file is part of Sulu.
5
 *
6
 * (c) MASSIVE ART WebServices GmbH
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Sulu\Bundle\ArticleBundle\DependencyInjection;
13
14
use Sulu\Bundle\ArticleBundle\Document\ArticleViewDocument;
15
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
16
use Symfony\Component\Config\Definition\ConfigurationInterface;
17
18
/**
19
 * Initializes configuration tree for article-bundle.
20
 */
21
class Configuration implements ConfigurationInterface
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26 1
    public function getConfigTreeBuilder()
27
    {
28 1
        $treeBuilder = new TreeBuilder();
29 1
        $treeBuilder->root('sulu_article')
30 1
            ->children()
31 1
                ->arrayNode('content_types')
32 1
                    ->addDefaultsIfNotSet()
33 1
                    ->children()
34 1
                        ->arrayNode('article')
35 1
                            ->addDefaultsIfNotSet()
36 1
                            ->children()
37 1
                                ->scalarNode('template')
38 1
                                ->defaultValue('SuluArticleBundle:Template:content-types/article-selection.html.twig')
39 1
                                ->end()
40 1
                            ->end()
41 1
                        ->end()
42 1
                        ->arrayNode('page_tree_route')
43 1
                            ->addDefaultsIfNotSet()
44 1
                            ->children()
45 1
                                ->scalarNode('template')
46 1
                                ->defaultValue('SuluArticleBundle:Template:content-types/page-tree-route.html.twig')
47 1
                                ->end()
48 1
                            ->end()
49 1
                        ->end()
50 1
                    ->end()
51 1
                ->end()
52 1
                ->arrayNode('documents')
53 1
                    ->addDefaultsIfNotSet()
54 1
                    ->children()
55 1
                        ->arrayNode('article')
56 1
                            ->addDefaultsIfNotSet()
57 1
                            ->children()
58 1
                                ->scalarNode('view')->defaultValue(ArticleViewDocument::class)->end()
59 1
                            ->end()
60 1
                        ->end()
61 1
                    ->end()
62 1
                ->end()
63 1
                ->arrayNode('types')
64 1
                    ->useAttributeAsKey('name')
65
                    ->prototype('array')
66 1
                        ->children()
67
                            ->scalarNode('translation_key')->end()
68
                        ->end()
69
                    ->end()
70
                ->end()
71
                ->scalarNode('display_tab_all')->defaultTrue()->info("Display tab 'all' in list view")->end()
72
            ->end();
73
74
        return $treeBuilder;
75
    }
76
}
77