Passed
Push — master ( 74531a...944a70 )
by Andrea
17:56
created

VersioneExtension   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A versioneTagGit() 0 5 1
A __construct() 0 3 1
A getFunctions() 0 4 1
1
<?php
2
3
namespace Fi\CoreBundle\Twig\Extension;
4
5
use Fi\CoreBundle\Controller\FiVersioneController;
6
7
class VersioneExtension extends \Twig_Extension
8
{
9
    protected $container;
10
11 34
    public function __construct($container = null)
12
    {
13 34
        $this->container = $container;
14 34
    }
15
16 11
    public function getFunctions()
17
    {
18
        return array(
19 11
            new \Twig_SimpleFunction('versione_tag_git', array($this, 'versioneTagGit', 'is_safe' => array('html'))),
20 11
        );
21
    }
22
23 13
    public function versioneTagGit()
24
    {
25 13
        FiVersioneController::versione($this->container);
26
27 13
        return FiVersioneController::$versione;
28
    }
29
}
30