Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2.0116 |
Changes | 0 |
1 | <?php |
||
40 | 1 | public function getTemplateFile(ViewInterface $view): string |
|
41 | { |
||
42 | 1 | $path = $view->getTemplatePath(); |
|
43 | 1 | $path = Utility::sanitizePath($path); |
|
44 | |||
45 | 1 | $template = $this->templateRoot . DIRECTORY_SEPARATOR . $path . $view->getTemplate() . '.php'; |
|
46 | |||
47 | 1 | if (!is_file($template)) { |
|
48 | throw new MissingTemplateException('Template file missing: ' . $template); |
||
49 | } |
||
50 | |||
51 | 1 | return $template; |
|
52 | } |
||
78 |