Completed
Push — master ( 7d1453...0dbf90 )
by Andrea
25:26 queued 23:30
created

VersioneExtension   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 23
ccs 6
cts 9
cp 0.6667
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getFunctions() 0 6 1
A versioneTagGit() 0 6 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 6
    public function __construct($container = null)
12
    {
13 6
        $this->container = $container;
14 6
    }
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 1
    public function versioneTagGit()
24
    {
25 1
        FiVersioneController::versione($this->container);
26
27 1
        return FiVersioneController::$versione;
28
    }
29
}
30