Passed
Push — master ( 17e906...d315bd )
by Andrea
40:07 queued 35:20
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
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
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
    public function __construct($container = null)
12
    {
13
        $this->container = $container;
14
    }
15
16
    public function getFunctions()
17
    {
18
        return array(
19
            new \Twig_SimpleFunction('versione_tag_git', array($this, 'versioneTagGit', 'is_safe' => array('html'))),
20
        );
21
    }
22
23
    public function versioneTagGit()
24
    {
25
        FiVersioneController::versione($this->container);
26
27
        return FiVersioneController::$versione;
28
    }
29
}
30