Passed
Push — master ( 20fa94...bcb279 )
by Michael
02:03
created

JsonApiConfiguration   A

Complexity

Total Complexity 1

Size/Duplication

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 20 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('mappers')
20 2
            ->defaultValue(['default' => [
21
                'handlers' => [
22
                    'attribute',
23
                    'relationship',
24
                    'link'
25
                ]
26
            ]])
27 2
            ->prototype('array')
28 2
                ->children()
29 2
                    ->arrayNode('handlers')
30 2
                        ->prototype('scalar');
31
32 2
        return $builder;
33
    }
34
}