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

TwigAwareKernel::addCompilerPasses()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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