TemplateReference::getLogicalName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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