SymfonyRouterCompiler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 27
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getHrefTemplate() 0 4 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