UtilitaExtension   A
last analyzed

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