Passed
Pull Request — master (#38)
by Christophe
08:39
created

LineChart   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Test Coverage

Coverage 47.62%

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 55
ccs 10
cts 21
cp 0.4762
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getPackage() 0 3 1
A getAvailableEventTypes() 0 10 1
A getType() 0 3 1
A __construct() 0 5 1
A getOptions() 0 3 1
A setOptions() 0 5 1
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Charts;
4
5
use CMEN\GoogleChartsBundle\GoogleCharts\Chart;
6
use CMEN\GoogleChartsBundle\GoogleCharts\EventType;
7
use CMEN\GoogleChartsBundle\GoogleCharts\Options\LineChart\LineChartOptions;
8
9
/**
10
 * @author Christophe Meneses
11
 */
12
class LineChart extends Chart
13
{
14
    /**
15
     * @var LineChartOptions
16
     */
17
    protected $options;
18
19 1
    public function __construct()
20
    {
21 1
        parent::__construct();
22
23 1
        $this->options = new LineChartOptions();
24 1
    }
25
26 1
    public function getType()
27
    {
28 1
        return 'LineChart';
29
    }
30
31 1
    public function getPackage()
32
    {
33 1
        return 'corechart';
34
    }
35
36
    public function getAvailableEventTypes()
37
    {
38
        return [
39
            EventType::ANIMATION_FINISH,
40
            EventType::CLICK,
41
            EventType::ERROR,
42
            EventType::ON_MOUSE_OUT,
43
            EventType::ON_MOUSE_OVER,
44
            EventType::READY,
45
            EventType::SELECT,
46
        ];
47
    }
48
49
    /**
50
     * @return LineChartOptions
51
     */
52 1
    public function getOptions()
53
    {
54 1
        return $this->options;
55
    }
56
57
    /**
58
     * @param LineChartOptions $options
59
     *
60
     * @return LineChart
61
     */
62
    public function setOptions($options)
63
    {
64
        $this->options = $options;
65
66
        return $this;
67
    }
68
}
69