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

OptionsOutput::draw()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
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