Passed
Push — master ( 0e8799...63c571 )
by Andrea
18:45 queued 41s
created

UtilitaExtension::getFunctions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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 11
    public function getFunctions()
14
    {
15
        return array(
16 11
            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