Passed
Push — master ( 86c140...b20c93 )
by Andrea
21:21 queued 20s
created

UtilitaExtension::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
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 10
    public function getFunctions()
14
    {
15
        return array(
16 10
            new \Twig_SimpleFunction('db2data', array($this, 'getDb2data', 'is_safe' => array('html'))),
17 10
        );
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