Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 48 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\CommentBundle\DependencyInjection;
13
14
use Sulu\Bundle\CommentBundle\Entity\Comment;
15
use Sulu\Bundle\CommentBundle\Entity\CommentRepository;
16
use Sulu\Bundle\CommentBundle\Entity\Thread;
17
use Sulu\Bundle\CommentBundle\Entity\ThreadRepository;
18
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
19
use Symfony\Component\Config\Definition\ConfigurationInterface;
20
21
/**
22
 * Build configuration-tree for sulu_comment.
23
 */
24
class Configuration implements ConfigurationInterface
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29 2
    public function getConfigTreeBuilder()
30
    {
31 2
        $treeBuilder = new TreeBuilder();
32 2
        $treeBuilder->root('sulu_comment')
33 2
            ->children()
34 2
                ->arrayNode('default_templates')
35 2
                    ->addDefaultsIfNotSet()
36 2
                    ->children()
37 2
                        ->scalarNode('comments')->defaultValue('SuluCommentBundle:WebsiteComment:comments.html.twig')->end()
38 2
                        ->scalarNode('comment')->defaultValue('SuluCommentBundle:WebsiteComment:comment.html.twig')->end()
39 2
                    ->end()
40 2
                ->end()
41 2
                ->arrayNode('types')
42 2
                    ->prototype('array')
43 2
                        ->children()
44 2
                            ->arrayNode('templates')
45 2
                                ->addDefaultsIfNotSet()
46 2
                                ->children()
47 2
                                    ->scalarNode('comments')->defaultValue('SuluCommentBundle:WebsiteComment:comments.html.twig')->end()
48 2
                                    ->scalarNode('comment')->defaultValue('SuluCommentBundle:WebsiteComment:comment.html.twig')->end()
49 2
                                ->end()
50 2
                            ->end()
51 2
                        ->end()
52 2
                    ->end()
53 2
                ->end()
54 2
                ->arrayNode('objects')
55 2
                    ->addDefaultsIfNotSet()
56 2
                    ->children()
57 2
                        ->arrayNode('comment')
58 2
                            ->addDefaultsIfNotSet()
59 2
                            ->children()
60 2
                                ->scalarNode('model')->defaultValue(Comment::class)->end()
61 2
                                ->scalarNode('repository')->defaultValue(CommentRepository::class)->end()
62 2
                            ->end()
63 2
                        ->end()
64 2
                        ->arrayNode('thread')
65 2
                            ->addDefaultsIfNotSet()
66 2
                            ->children()
67 2
                                ->scalarNode('model')->defaultValue(Thread::class)->end()
68 2
                                ->scalarNode('repository')->defaultValue(ThreadRepository::class)->end()
69 2
                            ->end()
70 2
                        ->end()
71 2
                    ->end()
72 2
                ->end()
73 2
            ->end();
74
75 2
        return $treeBuilder;
76
    }
77
}
78