Completed
Push — master ( d9bece...2ea354 )
by Andrea
10:06
created

VersioneExtension   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A versioneTagGit() 0 6 1
A getFunctions() 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 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