Completed
Pull Request — master (#81)
by
unknown
28:56
created

ExpressionLanguageCompilerPass   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 15 3
1
<?php
2
/**
3
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
4
 * @license For full copyright and license information view LICENSE file distributed with this source code.
5
 */
6
namespace Kaliop\eZMigrationBundle\DependencyInjection\CompilerPass;
7
8
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
9
use Symfony\Component\DependencyInjection\ContainerBuilder;
10
use Symfony\Component\DependencyInjection\Reference;
11
12
class ExpressionLanguageCompilerPass implements CompilerPassInterface
13
{
14
    public function process(ContainerBuilder $container)
15
    {
16
        if (!$container->hasDefinition('ez_migration_bundle.expression_language')) {
17
            return;
18
        }
19
20
        $providers = [];
21
        foreach ($container->findTaggedServiceIds('ez_migration_bundle.expression_language.function_provider') as $serviceId => $tags) {
22
            $providers[] = new Reference($serviceId);
23
        }
24
25
        $container
26
            ->getDefinition('ez_migration_bundle.expression_language')
27
            ->setArguments([null, $providers]);
28
    }
29
}
30