RegisterSerializerMetadataPass   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 3

Test Coverage

Coverage 100%
Metric Value
wmc 1
cbo 3
dl 0
loc 13
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 7 1
1
<?php
2
3
/*
4
 * This file is part of the xAPI package.
5
 *
6
 * (c) Christian Flothmann <[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
namespace Xabbuh\XApi\Bundle\ClientBundle\DependencyInjection\Compiler;
13
14
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Xabbuh\XApi\Serializer\Serializer;
17
18
/**
19
 * Compiler pass adding Serializer metadata for the xAPI model classes.
20
 *
21
 * @author Christian Flothmann <[email protected]>
22
 */
23
class RegisterSerializerMetadataPass implements CompilerPassInterface
24
{
25
    /**
26
     * {@inheritDoc}
27
     */
28 1
    public function process(ContainerBuilder $container)
29
    {
30 1
        $fileLocator = $container->findDefinition('jms_serializer.metadata.file_locator');
31 1
        $dirs = $fileLocator->getArgument(0);
32 1
        $dirs['Xabbuh\XApi\Model'] = Serializer::getMetadataDirectory();
33 1
        $fileLocator->replaceArgument(0, $dirs);
34 1
    }
35
}
36