Data   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isFirstRowIsData() 0 3 1
A setArrayToDataTable() 0 4 1
A getArrayToDataTable() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts;
4
5
/**
6
 * @author Christophe Meneses
7
 */
8
class Data
9
{
10
    /**
11
     * @var array<mixed>
12
     */
13
    private array $arrayToDataTable;
14
15
    private bool $firstRowIsData;
16
17 14
    public function __construct()
18
    {
19 14
        $this->arrayToDataTable = [];
20 14
        $this->firstRowIsData = false;
21
    }
22
23
    /**
24
     * @return array<mixed>
25
     */
26 5
    public function getArrayToDataTable(): array
27
    {
28 5
        return $this->arrayToDataTable;
29
    }
30
31
    /**
32
     * This method takes in a two-dimensional array. The data types of each column are interpreted automatically from
33
     * the data given. If a cell has no value, specify a null or empty value as appropriate. Column data types can also
34
     * be specified using the object literal notation in the first row (the column header row) of the array
35
     * (i.e. ['label' => 'Start Date', 'type' => 'date']). Optional data roles may be used as well, but they must be
36
     * defined explicitly using object literal notation. Object literal notation may also be used for any cell,
37
     * allowing you to define Cell Objects).
38
     *
39
     * @param array<mixed> $arrayToDataTable a two-dimensional array, where each row represents a row in the data table
40
     * @param bool         $firstRowIsData   if firstRowIsData is false (the default), the first row will be interpreted
41
     *                                       as header labels
42
     *
43
     * @return void
44
     */
45 5
    public function setArrayToDataTable(array $arrayToDataTable, bool $firstRowIsData = false)
46
    {
47 5
        $this->arrayToDataTable = $arrayToDataTable;
48 5
        $this->firstRowIsData = $firstRowIsData;
49
    }
50
51 4
    public function isFirstRowIsData(): bool
52
    {
53 4
        return $this->firstRowIsData;
54
    }
55
}
56