TwigAwareKernel   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 12
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addCompilerPasses() 0 5 1
A getExtensions() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gnutix\Kernel;
6
7
use Gnutix\Twig\DependencyInjection\Extension as TwigExtension;
8
use Symfony\Bundle\TwigBundle\DependencyInjection\Compiler\TwigEnvironmentPass as SymfonyTwigEnvironmentPass;
9
use Symfony\Component\DependencyInjection\ContainerBuilder;
10
11
abstract class TwigAwareKernel extends Kernel
12
{
13
    protected function getExtensions(): array
14
    {
15
        return array_merge(parent::getExtensions(), [new TwigExtension()]);
16
    }
17
18
    protected function addCompilerPasses(ContainerBuilder $container): void
19
    {
20
        parent::addCompilerPasses($container);
21
22
        $container->addCompilerPass(new SymfonyTwigEnvironmentPass());
23
    }
24
}
25