Passed
Push — develop ( d119f8...906029 )
by Andrea
15:21
created

UtilitaExtension::getParameter()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 6
ccs 0
cts 4
cp 0
crap 6
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