Completed
Pull Request — master (#46)
by Vladimir
02:44
created

StakxTwigFileLoader   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
lcom 0
cbo 2
dl 0
loc 14
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCacheKey() 0 11 2
1
<?php
2
3
/**
4
 * @copyright 2017 Vladimir Jimenez
5
 * @license   https://github.com/allejo/stakx/blob/master/LICENSE.md MIT
6
 */
7
8
namespace allejo\stakx\Twig;
9
10
use allejo\stakx\Command\BuildableCommand;
11
use allejo\stakx\Service;
12
13
class StakxTwigFileLoader 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