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

UtilitaExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 15
ccs 2
cts 4
cp 0.5
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A jsonDecode() 0 3 1
A getFunctions() 0 4 1
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