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

UtilitaExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 17
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDb2data() 0 5 1
A getFunctions() 0 4 1
1
<?php
2
3
namespace Fi\CoreBundle\Twig\Extension;
4
5
use Fi\CoreBundle\Controller\FiUtilita;
6
7
class UtilitaExtension extends \Twig_Extension
8
{
9
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function getFunctions()
14
    {
15
        return array(
16
            new \Twig_SimpleFunction('db2data', array($this, 'getDb2data', 'is_safe' => array('html'))),
17
        );
18
    }
19
    public function getDb2data($giorno)
20
    {
21
        // highlight_string highlights php code only if '<?php' tag is present.
22
23
        return FiUtilita::db2data($giorno, true);
24
    }
25
}
26