TableHeadSorted   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A fillInputs() 0 4 1
A templatePath() 0 3 1
A setData() 0 5 2
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 TableHeadSorted extends ATemplate
11
{
12
    use TFile;
13
14
    protected function templatePath(): string
15
    {
16
        return __DIR__ . '/../../shared-templates/table-head-sorted.html';
17
    }
18
19
    protected function fillInputs(): void
20
    {
21
        $this->addInput('{HEAD_CONTENT}');
22
        $this->addInput('{SORTER_LINK}');
23
    }
24
25
    public function setData(string $headContent, ?string $sorterLink): self
26
    {
27
        $this->updateItem('{HEAD_CONTENT}', $headContent);
28
        $this->updateItem('{SORTER_LINK}', is_null($sorterLink) ? '#' : $sorterLink);
29
        return $this;
30
    }
31
}
32