1 | <?php |
||
19 | class HtmlReport implements ReportInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var \Twig_Environment |
||
23 | */ |
||
24 | private $twig; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private $template; |
||
30 | |||
31 | /** |
||
32 | * HtmlReport constructor. |
||
33 | * @param string $templatesDir |
||
34 | * @param array $optionTwig |
||
35 | */ |
||
36 | 4 | public function __construct($templatesDir = '', $optionTwig = []) |
|
48 | |||
49 | /** |
||
50 | * Build html report. |
||
51 | * |
||
52 | * @param DocumentInterface $document |
||
53 | * @param array $parameters |
||
54 | * @return mixed |
||
55 | * @throws \Twig_Error_Loader |
||
56 | * @throws \Twig_Error_Runtime |
||
57 | * @throws \Twig_Error_Syntax |
||
58 | */ |
||
59 | 4 | public function render(DocumentInterface $document, $parameters = []) |
|
68 | |||
69 | /** |
||
70 | * Set filename templte. |
||
71 | * |
||
72 | * @param string $template |
||
73 | */ |
||
74 | 4 | public function setTemplate($template) |
|
78 | |||
79 | /** |
||
80 | * @return \Twig_Environment |
||
81 | */ |
||
82 | 4 | public function getTwig() |
|
86 | |||
87 | /** |
||
88 | * @param $directory |
||
89 | * @param $options |
||
90 | * @return \Twig_Environment |
||
91 | */ |
||
92 | 4 | private function buildTwig($directory, $options) |
|
101 | } |