Test Failed
Push — master ( d818fc...2d2f9a )
by Christophe
08:50
created

OptionsOutput   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A draw() 0 11 1
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\Output\Javascript;
4
5
use CMEN\GoogleChartsBundle\GoogleCharts\Options\ChartOptionsInterface;
6
use CMEN\GoogleChartsBundle\Output\AbstractOptionsOutput;
7
8
/**
9
 * @author Christophe Meneses
10
 */
11
class OptionsOutput extends AbstractOptionsOutput
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function draw(ChartOptionsInterface $options, $optionsName)
17
    {
18
        $this->removeRecursivelyNullValue($options);
19
20
        /* @var array $options */
21
        $this->removeRecursivelyEmptyArray($options);
22
23
        $options = $this->renameRecursivelyKeys($options);
24
25
        return "var $optionsName = ".json_encode($options).";\n";
26
    }
27
}
28