TemplateReference   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 31
ccs 14
cts 14
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPath() 0 4 1
A getLogicalName() 0 4 1
A __construct() 0 12 1
1
<?php
2
namespace Boekkooi\Bundle\TwigJackBundle\Templating;
3
4
use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference as BaseTemplateReference;
5
6
/**
7
 * @author Warnar Boekkooi <[email protected]>
8
 */
9
class TemplateReference extends BaseTemplateReference
10
{
11 2
    public function __construct($path, BaseTemplateReference $childReference)
12
    {
13 2
        parent::__construct(
14 2
            $childReference->get('bundle'),
15 2
            $childReference->get('controller'),
16 2
            $childReference->get('name'),
17 2
            $childReference->get('format'),
18 2
            $childReference->get('engine')
19 2
        );
20
21 2
        $this->parameters['path'] = $path;
22 2
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27 2
    public function getPath()
28
    {
29 2
        return $this->get('path');
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35 2
    public function getLogicalName()
36
    {
37 2
        return '!' . parent::getLogicalName();
38
    }
39
}
40