Completed
Push — master ( 7a069b...4da1f4 )
by Paweł
11s
created

OverrideTwigContentCache   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher Core Bundle.
5
 *
6
 * Copyright 2016 Sourcefabric z.ú. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2016 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Bundle\CoreBundle\DependencyInjection\Compiler;
16
17
use SWP\Bundle\CoreBundle\Twig\Cache\Strategy\LifetimeCacheStrategy;
18
use Symfony\Component\DependencyInjection\ContainerBuilder;
19
use Symfony\Component\DependencyInjection\Reference;
20
21
final class OverrideTwigContentCache extends AbstractOverridePass
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function process(ContainerBuilder $container)
27
    {
28
        $lifetimeStrategyDefinition = $this->getDefinitionIfExists($container, 'twig_cache.strategy.lifetime');
29
        $lifetimeStrategyDefinition->setClass(LifetimeCacheStrategy::class);
30
        $lifetimeStrategyDefinition->addArgument(new Reference('swp_multi_tenancy.tenant_context'));
31
    }
32
}
33