DynamicServiceCacheCompilerPass::process()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 9
rs 9.6666
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
/**
4
 * ZohoSubscription Bundle
5
 *
6
 * @author Tristan Bessoussa <[email protected]>
7
 */
8
9
namespace StoreFactory\ZohoSubscriptionBundle\CompilerPass;
10
11
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
12
use Symfony\Component\DependencyInjection\ContainerBuilder;
13
use Symfony\Component\DependencyInjection\Reference;
14
15
class DynamicServiceCacheCompilerPass implements CompilerPassInterface
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function process(ContainerBuilder $container)
21
    {
22
        if ($container->getParameter('zoho_subscription.cache.service') !== null) {
23
            $container
24
                ->getDefinition('zoho.api.manager')
25
                ->replaceArgument(2, new Reference($container->getParameter('zoho_subscription.cache.service')))
26
            ;
27
        }
28
    }
29
}
30