| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | public function renderTemplate(string $templatePath, $context = []): Template |
||
| 21 | { |
||
| 22 | $template = $this->twig->load($templatePath); |
||
| 23 | |||
| 24 | $subj = $template->renderBlock('subject', $context); |
||
| 25 | $text = $template->renderBlock('text', $context); |
||
| 26 | $html = null; |
||
| 27 | |||
| 28 | if ($template->hasBlock('html', $context)) { |
||
| 29 | $html = $template->renderBlock('html', $context); |
||
| 30 | } |
||
| 31 | |||
| 32 | return new Template($subj, $text, $html); |
||
| 33 | } |
||
| 35 |