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

JsonApiConfiguration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 20
ccs 10
cts 10
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 14
nc 1
nop 0
crap 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
}