Conditions | 1 |
Paths | 1 |
Total Lines | 25 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 19 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
9 | 2 | public function render(string $view, array $data = []) : string |
|
10 | { |
||
11 | 2 | $content = $this->getContent($view); |
|
12 | 2 | $content = new Inheritance($content, $this->config); |
|
13 | 2 | $content = new IncludeTpl($content, $this->config); |
|
14 | 2 | $content = new ForeachTpl($content); |
|
15 | 2 | $content = new IfTpl($content); |
|
16 | 2 | $content = new FuncTpl($content); |
|
17 | 2 | $content = new VariableTpl($content); |
|
18 | |||
19 | |||
20 | 2 | $this->data = array_merge($data, $this->data); |
|
21 | 2 | extract($this->data); |
|
22 | 2 | $tmp = tmpfile(); |
|
23 | |||
24 | 2 | fwrite($tmp, $content); |
|
|
|||
25 | 2 | fseek($tmp, 0); |
|
26 | |||
27 | 2 | ob_start(); |
|
28 | 2 | $file = stream_get_meta_data($tmp); |
|
29 | |||
30 | 2 | include $file['uri']; |
|
31 | 2 | $content = ob_get_clean(); |
|
32 | 2 | fclose($tmp); |
|
33 | 2 | return $content; |
|
34 | } |
||
36 |