Completed
Push — master ( af09d7...7599bb )
by Dorian
02:06
created

TwigAwareKernel   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 14
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getExtensions() 0 4 1
A addCompilerPasses() 0 6 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