SeriesTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 28
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A setSeries() 0 5 1
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options;
4
5
/**
6
 * @author Christophe Meneses
7
 */
8
trait SeriesTrait
9
{
10
    /**
11
     * An array of Series object, each describing the format of the corresponding series in the chart. To use default
12
     * values for a series, specify a null value. If a series or a value is not specified, the global value
13
     * will be used.
14
     *
15
     * You can specify either an array of Series object, each of which applies to the series in the order given,
16
     * or you can specify an array where each child has a numeric key indicating which series it applies to.
17
     * For example, the following two declarations are identical :
18
     *
19
     * $chart->getOptions()->setSeries([$series1, null, $series3]);
20
     * $chart->getOptions()->setSeries([0 => $series1, 2 => $series3])
21
     *
22
     * @var array<mixed>|Series[]
23
     */
24
    protected $series;
25
26
    /**
27
     * @param array<mixed>|Series[] $series
28
     *
29
     * @return $this
30
     */
31 2
    public function setSeries(array $series)
32
    {
33 2
        $this->series = $series;
34
35 2
        return $this;
36
    }
37
}
38