| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | 2 | public function render(string $view, array $data = []): string |
|
| 16 | { |
||
| 17 | 2 | $content = $this->handle($this->getContent($view, $this->config)); |
|
| 18 | |||
| 19 | 2 | $this->data = array_merge($data, $this->data); |
|
| 20 | |||
| 21 | 2 | $fname = getcwd() . '/' . $this->config['cache_dir'] . '/' . $view . '.phtml'; |
|
| 22 | |||
| 23 | 2 | $file = new File; |
|
| 24 | |||
| 25 | 2 | if ($file->create($fname) !== false) { |
|
| 26 | 2 | $file->write($content); |
|
| 27 | 2 | $content = $file->read($this->data); |
|
| 28 | 2 | $file->close(); |
|
| 29 | } |
||
| 30 | |||
| 31 | 2 | return $content; |
|
| 32 | } |
||
| 46 |