DirectRenderer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 6
c 0
b 0
f 0
dl 0
loc 18
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 3 1
A __construct() 0 4 1
A getTemplate() 0 3 1
1
<?php
2
3
namespace kalanis\kw_table\output_direct;
4
5
6
use kalanis\kw_table\core\Table;
7
8
9
/**
10
 * Class DirectRenderer
11
 * @package kalanis\kw_table\output_direct
12
 * Direct renderer into PHP template
13
 */
14
class DirectRenderer extends Table\AOutput
15
{
16
    protected Template $template;
17
18
    public function __construct(Table $table)
19
    {
20
        parent::__construct($table);
21
        $this->template = new Template();
22
    }
23
24
    public function getTemplate(): Template
25
    {
26
        return $this->template;
27
    }
28
29
    public function render(): string
30
    {
31
        return $this->template->render($this->table);
32
    }
33
}
34