Total Complexity | 6 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | class Tpl |
||
8 | { |
||
9 | private static $assign = []; |
||
10 | private static $engine = null; |
||
11 | |||
12 | /** |
||
13 | * @return Engine |
||
14 | */ |
||
15 | 2 | private static function engine(): Engine |
|
16 | { |
||
17 | 2 | if (!isset(self::$engine) || is_null(self::$engine)) { |
|
18 | 2 | self::$engine = new Engine; |
|
19 | } |
||
20 | |||
21 | 2 | return self::$engine; |
|
22 | } |
||
23 | |||
24 | /** |
||
25 | * @param array $config |
||
26 | */ |
||
27 | 2 | public static function config(array $config): void |
|
30 | 2 | } |
|
31 | |||
32 | /** |
||
33 | * @param string $key |
||
34 | * @param $value |
||
35 | */ |
||
36 | 2 | public static function assign(string $key, $value): void |
|
39 | 2 | } |
|
40 | |||
41 | /** |
||
42 | * @param string $template |
||
43 | * @return string |
||
44 | */ |
||
45 | 2 | public static function render(string $template): string |
|
48 | } |
||
49 | } |
||
50 |