Passed
Push — feature/uploadable ( 7c6d25...a7ed20 )
by Daniel
11:07
created

SerializerCompilerPass   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 6 1
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