Passed
Push — master ( d27c52...62b14a )
by Andrea
18:17
created

VersioneExtension   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 21
ccs 6
cts 8
cp 0.75
rs 10
c 0
b 0
f 0

3 Methods

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