| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | 4 | public function load() |
|
| 39 | { |
||
| 40 | 4 | $content = require $this->entity; |
|
| 41 | |||
| 42 | 4 | if (is_callable($content)) { |
|
| 43 | 1 | $content = call_user_func($content); |
|
| 44 | } |
||
| 45 | |||
| 46 | 4 | if (!is_array($content)) { |
|
| 47 | 1 | throw new \RuntimeException(sprintf("'%s' does not return an array", $this->entity)); |
|
| 48 | } |
||
| 49 | |||
| 50 | 3 | $this->content = $content; |
|
| 51 | 3 | return $this; |
|
| 52 | } |
||
| 53 | } |
||
| 54 |