| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php namespace PascalKleindienst\FormListGenerator\Support; |
||
| 47 | 21 | public function render($file, array $data = []) |
|
| 48 | { |
||
| 49 | // Check if file exists |
||
| 50 | 21 | $fullpath = $this->getFileName($file); |
|
| 51 | |||
| 52 | 21 | if (!file_exists($fullpath)) { |
|
| 53 | 3 | throw new \InvalidArgumentException('Could not find file with name ' . $file); |
|
| 54 | } |
||
| 55 | |||
| 56 | // load file |
||
| 57 | 18 | extract($data); |
|
| 58 | 18 | include($fullpath); |
|
| 59 | 18 | } |
|
| 60 | |||
| 82 |