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

VersioneExtension::getFunctions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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