Passed
Push — master ( 6ba977...0a48c5 )
by Michael
07:39
created

JsonApiConfiguration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
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 32
ccs 15
cts 15
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 26 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Mikemirten\Bundle\JsonApiBundle\DependencyInjection;
5
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
8
9
class JsonApiConfiguration implements ConfigurationInterface
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14 2
    public function getConfigTreeBuilder()
15
    {
16 2
        $builder  = new TreeBuilder();
17 2
        $children = $builder->root('mrtn_json_api')->children();
18
19 2
        $children->arrayNode('view_listener_mapping_handler')
20 2
            ->addDefaultsIfNotSet()
21 2
            ->children()
22 2
                ->scalarNode('default_mapper')
23 2
                    ->defaultValue('default');
24
25 2
        $children->arrayNode('mappers')
26 2
            ->defaultValue(['default' => [
27
                'handlers' => [
28
                    'attribute',
29
                    'relationship',
30
                    'link'
31
                ]
32
            ]])
33 2
            ->prototype('array')
34 2
                ->children()
35 2
                    ->arrayNode('handlers')
36 2
                        ->prototype('scalar');
37
38 2
        return $builder;
39
    }
40
}