Passed
Push — master ( 413ea4...a7ed20 )
by Daniel
22:03 queued 16:10
created

SerializerCompilerPass::process()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the Silverback API Components Bundle Project
5
 *
6
 * (c) Daniel West <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Silverback\ApiComponentsBundle\DependencyInjection\CompilerPass;
15
16
use Silverback\ApiComponentsBundle\Serializer\MappingLoader\PublishableLoader;
17
use Silverback\ApiComponentsBundle\Serializer\MappingLoader\TimestampedLoader;
18
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
19
use Symfony\Component\DependencyInjection\ContainerBuilder;
20
use Symfony\Component\DependencyInjection\Reference;
21
22
/**
23
 * @author Vincent Chalamon <[email protected]>
24
 */
25
class SerializerCompilerPass implements CompilerPassInterface
26
{
27 1
    public function process(ContainerBuilder $container)
28
    {
29 1
        $definition = $container->getDefinition('serializer.mapping.chain_loader');
30 1
        $definition->replaceArgument(0, array_merge($definition->getArgument(0), [
31 1
            new Reference(PublishableLoader::class),
32 1
            new Reference(TimestampedLoader::class),
33
        ]));
34 1
    }
35
}
36