Completed
Push — master ( 176c47...6ec24e )
by Andrea
18:17 queued 14:57
created

UtilitaExtension::getDb2data()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Cdf\BiCoreBundle\Twig\Extension;
4
5
class UtilitaExtension extends \Twig_Extension
6
{
7
    /**
8
     * {@inheritdoc}
9
     */
10
    public function getFunctions()
11
    {
12
        return array(
13
            new \Twig_SimpleFunction('json_decode', array($this, 'jsonDecode', 'is_safe' => array('html'))),
14
        );
15
    }
16
    
17 6
    public function jsonDecode($string)
18
    {
19 6
        return json_decode($string);
20
    }
21
}
22