TableCell   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 8
c 0
b 0
f 0
dl 0
loc 20
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A templatePath() 0 3 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 TableCell extends ATemplate
11
{
12
    use TFile;
13
14
    protected function templatePath(): string
15
    {
16
        return __DIR__ . '/../../shared-templates/table-cell.html';
17
    }
18
19
    protected function fillInputs(): void
20
    {
21
        $this->addInput('{CELL_CONTENT}');
22
        $this->addInput('{CELL_STYLE}');
23
    }
24
25
    public function setData(string $cellContent, string $cellStyle = ''): self
26
    {
27
        $this->updateItem('{CELL_CONTENT}', $cellContent);
28
        $this->updateItem('{CELL_STYLE}', $cellStyle);
29
        return $this;
30
    }
31
}
32