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

UtilitaExtension::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 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