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