| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | public static function getContent(string $view): string |
||
| 8 | { |
||
| 9 | $view = str_replace('.', '/', $view); |
||
| 10 | $file = Tpl::getDir() . "$view.php"; |
||
| 11 | |||
| 12 | if (!file_exists($file)) { |
||
| 13 | throw new \Exception("$file template not found"); // @codeCoverageIgnore |
||
| 14 | } |
||
| 15 | |||
| 16 | return file_get_contents($file); |
||
| 17 | } |
||
| 19 |