Row   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 8
c 0
b 0
f 0
dl 0
loc 30
rs 10
ccs 10
cts 10
cp 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A addColumn() 0 3 1
A getIterableName() 0 3 1
A setSource() 0 3 1
A getSource() 0 3 1
1
<?php
2
3
namespace kalanis\kw_table\core\Table\Internal;
4
5
6
use kalanis\kw_connect\core\Interfaces\IRow;
7
use kalanis\kw_table\core\Interfaces\Table\IColumn;
8
use kalanis\kw_table\core\Table\AStyle;
9
use kalanis\kw_table\core\Table\TSourceName;
10
11
12
/**
13
 * Class Row
14
 * @package kalanis\kw_table\core\Table\Internal
15
 * Styled row in table
16
 */
17
class Row extends AStyle
18
{
19
    use TSourceName;
20
21
    /** @var IColumn[] */
22
    protected array $columns = [];
23
    protected ?IRow $sourceData = null;
24
25
    /**
26
     * Add column with entry into the stack
27
     * @param IColumn $column
28
     */
29 22
    public function addColumn(IColumn $column): void
30
    {
31 22
        $this->columns[] = $column;
32 22
    }
33
34 22
    public function setSource(IRow $source): void
35
    {
36 22
        $this->sourceData = $source;
37 22
    }
38
39 17
    public function getSource(): ?IRow
40
    {
41 17
        return $this->sourceData;
42
    }
43
44 16
    protected function getIterableName(): string
45
    {
46 16
        return 'columns';
47
    }
48
}
49