Conditions | 2 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | 2 | public static function renderTemplate(string $filename, array $variables): string |
|
32 | { |
||
33 | 2 | extract($variables); |
|
34 | 2 | ob_start(); |
|
35 | |||
36 | try { |
||
37 | 2 | include $filename; |
|
38 | /** @var string */ |
||
39 | 1 | return ob_get_clean(); |
|
40 | 1 | } catch (Throwable $e) { |
|
41 | 1 | ob_end_clean(); |
|
42 | 1 | throw $e; |
|
43 | } |
||
46 |