Completed
Push — master ( 74371a...6da8c0 )
by Vladimir
02:21
created

TwigFileLoader   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 14
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCacheKey() 0 11 2
1
<?php
2
3
/**
4
 * @copyright 2018 Vladimir Jimenez
5
 * @license   https://github.com/allejo/stakx/blob/master/LICENSE.md MIT
6
 */
7
8
namespace allejo\stakx\Templating\Twig;
9
10
use allejo\stakx\Command\BuildableCommand;
11
use allejo\stakx\Service;
12
13
class TwigFileLoader extends \Twig_Loader_Filesystem
14
{
15
    public function getCacheKey($name)
16
    {
17
        $path = $this->findTemplate($name);
18
19
        if (Service::getParameter(BuildableCommand::WATCHING))
20
        {
21
            return $path . filemtime($path);
22
        }
23
24
        return $path;
25
    }
26
}
27