SymfonyRouterCompiler::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 3
crap 1
1
<?php
2
3
namespace Bankiru\Seo\Destination\Compiler;
4
5
use Bankiru\Seo\Destination\DestinationNormalizer;
6
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
7
8
final class SymfonyRouterCompiler extends AbstractCompiler
9
{
10
    /** @var  UrlGeneratorInterface */
11
    private $generator;
12
13
    /**
14
     * SymfonyRouterCompiler constructor.
15
     *
16
     * @param DestinationNormalizer $normalizer
17
     * @param \Twig_Environment     $twig
18
     * @param UrlGeneratorInterface $generator
19
     */
20 1
    public function __construct(
21
        DestinationNormalizer $normalizer,
22
        \Twig_Environment $twig = null,
23
        UrlGeneratorInterface $generator
24
    ) {
25 1
        parent::__construct($normalizer, $twig);
26 1
        $this->generator = $generator;
27 1
    }
28
29
    /** {@inheritdoc} */
30 1
    protected function getHrefTemplate($route)
31
    {
32 1
        return new LazyCompilableLink($route, $this->generator);
33
    }
34
}
35