|
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
|
|
|
|