TemplateHelper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
c 0
b 0
f 0
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 10 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WebServCo\Framework\Helpers;
6
7
class TemplateHelper
8
{
9
    /**
10
    * @param array<int|string,mixed> $data
11
    */
12
    public static function render(string $templatePath, string $templateName, array $data): string
13
    {
14
        $output = new \WebServCo\Framework\Libraries\HtmlOutput();
15
        foreach ($data as $k => $v) {
16
            $output->setData($k, $v);
17
        }
18
        $output->setPath($templatePath);
19
20
        $output->setTemplate($templateName);
21
        return $output->render();
22
    }
23
}
24