Template   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 44
ccs 16
cts 16
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A getInstance() 0 8 2
A getEngine() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: arnaud
5
 * Date: 21/11/15
6
 * Time: 17:25
7
 */
8
9
namespace Ndrx\Profiler\Renderer\Html;
10
11
class Template
12
{
13
14
    /**
15
     * @var \Twig_Environment
16
     */
17
    protected $engine;
18
19
    protected static $instance;
20
21
    /**
22
     *
23
     */
24 2
    protected function __construct()
25
    {
26 2
        $loader = new \Twig_Loader_Filesystem([
27 2
            __DIR__ . DIRECTORY_SEPARATOR . '..'
28 2
            . DIRECTORY_SEPARATOR . '..'
29 2
            . DIRECTORY_SEPARATOR . '..'
30 2
            . DIRECTORY_SEPARATOR . 'views'
31 2
        ]);
32 2
        $this->engine = new \Twig_Environment($loader);
33 2
    }
34
35
    /**
36
     * @return Template
37
     */
38 88
    public static function getInstance()
39
    {
40 88
        if (self::$instance === null) {
41 2
            self::$instance = new self();
42 2
        }
43
44 88
        return self::$instance;
45
    }
46
47
    /**
48
     * @return \Twig_Environment
49
     */
50 88
    public function getEngine()
51
    {
52 88
        return $this->engine;
53
    }
54
}
55