Passed
Push — master ( d315bd...0bda70 )
by Andrea
12:20
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 17
    public function __construct($container = null)
12
    {
13 17
        $this->container = $container;
14 17
    }
15
16 10
    public function getFunctions()
17
    {
18
        return array(
19 10
            new \Twig_SimpleFunction('versione_tag_git', array($this, 'versioneTagGit', 'is_safe' => array('html'))),
20 10
        );
21
    }
22
23 10
    public function versioneTagGit()
24
    {
25 10
        FiVersioneController::versione($this->container);
26
27 10
        return FiVersioneController::$versione;
28
    }
29
}
30