PayseraNormalizationBundle::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 29

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 22
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 29
ccs 22
cts 22
cp 1
rs 9.456
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Paysera\Bundle\NormalizationBundle;
5
6
use Paysera\Component\DependencyInjection\AddTaggedCompilerPass;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\HttpKernel\Bundle\Bundle;
9
10
class PayseraNormalizationBundle extends Bundle
11
{
12 6
    public function build(ContainerBuilder $container)
13
    {
14
        // must be TypeAwareInterface, added with autoconfiguration, registered by implemented interfaces
15 6
        $container->addCompilerPass(new AddTaggedCompilerPass(
16 6
            'paysera_normalization.normalizer_registry_provider',
17 6
            'paysera_normalization.autoconfigured_normalizer',
18 6
            'addTypeAwareNormalizer',
19 6
            ['group' => null]
20
        ));
21
22 6
        $container->addCompilerPass(new AddTaggedCompilerPass(
23 6
            'paysera_normalization.normalizer_registry_provider',
24 6
            'paysera_normalization.normalizer',
25 6
            'addNormalizer',
26 6
            ['type' => null, 'group' => null]
27
        ));
28 6
        $container->addCompilerPass(new AddTaggedCompilerPass(
29 6
            'paysera_normalization.normalizer_registry_provider',
30 6
            'paysera_normalization.mixed_type_denormalizer',
31 6
            'addMixedTypeDenormalizer',
32 6
            ['type' => null, 'group' => null]
33
        ));
34 6
        $container->addCompilerPass(new AddTaggedCompilerPass(
35 6
            'paysera_normalization.normalizer_registry_provider',
36 6
            'paysera_normalization.object_denormalizer',
37 6
            'addObjectDenormalizer',
38 6
            ['type' => null, 'group' => null]
39
        ));
40 6
    }
41
}
42