Completed
Push — master ( 2c723d...233fcc )
by Yaroslav
01:56
created

SetTwigVariablesPass::process()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
3
namespace Harentius\BlogBundle\DependencyInjection\CompilerPass;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
8
class SetTwigVariablesPass implements CompilerPassInterface
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function process(ContainerBuilder $container)
14
    {
15
        $definition = $container->getDefinition('twig');
16
        $definition->addMethodCall(
17
            'addGlobal',
18
            ['image_previews_base_uri', $container->getParameter('harentius_blog.articles.image_previews_base_uri')]
19
        );
20
    }
21
}
22