TableRow   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 11
c 0
b 0
f 0
dl 0
loc 27
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A templatePath() 0 3 1
A addCell() 0 4 1
A fillInputs() 0 4 1
A setData() 0 5 1
1
<?php
2
3
namespace kalanis\kw_table\output_kw\Html;
4
5
6
use kalanis\kw_templates\ATemplate;
7
use kalanis\kw_templates\Template\TFile;
8
9
10
class TableRow extends ATemplate
11
{
12
    use TAppend;
13
    use TFile;
14
15
    protected function templatePath(): string
16
    {
17
        return __DIR__ . '/../../shared-templates/table-row.html';
18
    }
19
20
    protected function fillInputs(): void
21
    {
22
        $this->addInput('{ROW_STYLE}');
23
        $this->addInput('{ROW_CONTENT}');
24
    }
25
26
    public function addCell(string $cellContent): self
27
    {
28
        $this->appendContent('{ROW_CONTENT}', $cellContent);
29
        return $this;
30
    }
31
32
    public function setData(string $rowStyle = ''): self
33
    {
34
        $this->updateItem('{ROW_STYLE}', $rowStyle);
35
        $this->updateItem('{ROW_CONTENT}', '');
36
        return $this;
37
    }
38
}
39