Passed
Pull Request — master (#53)
by Matthew
02:21
created

TemplateRenderService   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 10
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A RenderTemplate() 0 2 1
A __construct() 0 3 1
1
<?php
2
namespace PhpDraft\Domain\Services;
3
4
class TemplateRenderService {
5
  private $twig;
6
7
  public function __construct() {
8
    $loader = new \Twig_Loader_Filesystem(__DIR__ . '/../../EmailTemplates');
9
    $this->twig = new \Twig_Environment($loader);
10
  }
11
12
  public function RenderTemplate($emailTemplateFilename, $parameters) {
13
    return $this->twig->render($emailTemplateFilename, $parameters);
14
  }
15
}
16