| Total Complexity | 4 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 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 |
|
| 54 | } |
||
| 55 | } |
||
| 56 |