Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 29
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 26 1
1
<?php
2
3
namespace SumoCoders\FrameworkMultiUserBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\ConfigurationInterface;
6
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
7
8
class Configuration implements ConfigurationInterface
9
{
10
    public function getConfigTreeBuilder(): TreeBuilder
11
    {
12
        $treeBuilder = new TreeBuilder();
13
        $rootNode = $treeBuilder->root('sumo_coders_framework_multi_user');
14
15
        $rootNode
16
            ->children()
17
                ->arrayNode('redirect_routes')
18
                    ->example([
19
                        'Acme\DemoBundle\Entity\User1' => 'dashboard_route',
20
                    ])
21
                    ->useAttributeAsKey('class')
22
                    ->prototype('array')
23
                        ->beforeNormalization()->ifString()->then(function ($v) {
24
                            return ['route' => $v];
25
                        })->end()
26
                        ->children()
27
                            ->scalarNode('route')->cannotBeEmpty()->end()
28
                        ->end()
29
                    ->end()
30
                ->end()
31
            ->end()
32
        ;
33
34
        return $treeBuilder;
35
    }
36
}
37