Completed
Push — master ( b8ee64...bf1b53 )
by Nikola
04:04
created

RateTypeCompilerPass::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 2
eloc 8
nc 2
nop 1
1
<?php
2
3
namespace RunOpenCode\Bundle\ExchangeRate\DependencyInjection\CompilerPass;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Reference;
8
9
class RateTypeCompilerPass implements CompilerPassInterface
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function process(ContainerBuilder $container)
15
    {
16
        if ($container->hasDefinition('run_open_code.exchange_rate.form_type.rate_type')) {
17
18
            $container
19
                ->getDefinition('run_open_code.exchange_rate.form_type.rate_type')
20
                ->setArguments(array(
21
                    new Reference('run_open_code.exchange_rate.registry.rates'),
22
                    new Reference('translator'),
23
                    $container->getParameter('run_open_code.exchange_rate.form_type.rate_type')
24
                ));
25
        }
26
    }
27
}
28