Completed
Pull Request — master (#70)
by Martin
02:59
created

TwitalLoaderTwigGte3::getCacheKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Goetas\Twital;
4
5
use Twig\Loader\LoaderInterface;
6
use Twig\Source;
7
8
/**
9
 * @author Martin Hasoň <[email protected]>
10
 */
11
class TwitalLoaderTwigGte3 implements LoaderInterface
12
{
13
    use TwitalLoaderTrait;
14
15
    public function __construct(LoaderInterface $loader = null, Twital $twital = null, $addDefaults = true)
16
    {
17
        $this->doConstruct($loader, $twital, $addDefaults);
18
    }
19
20
    public function getSourceContext(string $name): Source
21
    {
22
        $context = $this->doGetSourceContext($name);
23
24
        return new Source($context[0], $context[1], $context[2]);
25
    }
26
27
    public function getCacheKey(string $name): string
28
    {
29
        return $this->loader->getCacheKey($name);
30
    }
31
32
    public function isFresh(string $name, int $time): bool
33
    {
34
        return $this->loader->isFresh($name, $time);
35
    }
36
37
    public function exists(string $name)
38
    {
39
        return $this->doExists($name);
40
    }
41
}
42