TwigFormThemePass::process()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
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 9
rs 9.6666
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace NVBooster\PHPCRAssetsBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7
use Symfony\Component\DependencyInjection\Exception\LogicException;
8
9
/**
10
 * @author nvb
11
 *
12
 */
13
class TwigFormThemePass implements CompilerPassInterface
14
{
15
    /**
16
     * @{inheritdoc}
17
     */
18
    public function process(ContainerBuilder $container)
19
    {
20
        if ($container->hasDefinition('nvbooster_assets.formtype.asset')) {           
21
            $twigFormThemes = $container->getParameter('twig.form.resources');
22
            $twigFormThemes[] = 'NVBoosterPHPCRAssetsBundle:Form:textasset_widget.html.twig';
23
            
24
            $container->setParameter('twig.form.resources', $twigFormThemes);
25
        }
26
    }
27
}