UtilitaExtension::getFunctions()   A
last analyzed

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
use Twig_Extension;
7
use Twig_SimpleFunction;
8
9
class UtilitaExtension extends Twig_Extension
0 ignored issues
show
Deprecated Code introduced by
The class Twig_Extension has been deprecated: since Twig 2.7, use "Twig\Extension\AbstractExtension" instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

9
class UtilitaExtension extends /** @scrutinizer ignore-deprecated */ Twig_Extension
Loading history...
10
{
11
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function getFunctions()
16
    {
17
        return array(
18
            new Twig_SimpleFunction('db2data', array($this, 'getDb2data', 'is_safe' => array('html'))),
0 ignored issues
show
Deprecated Code introduced by
The class Twig_SimpleFunction has been deprecated: since Twig 2.7, use "Twig\TwigFunction" instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

18
            /** @scrutinizer ignore-deprecated */ new Twig_SimpleFunction('db2data', array($this, 'getDb2data', 'is_safe' => array('html'))),
Loading history...
19
        );
20
    }
21
    public function getDb2data($giorno)
22
    {
23
        // highlight_string highlights php code only if '<?php' tag is present.
24
25
        return FiUtilita::db2data($giorno, true);
26
    }
27
}
28