| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public function getContent(): string |
||
| 43 | { |
||
| 44 | if ($this->content === null) { |
||
| 45 | set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); |
||
| 46 | $content = file_get_contents($this->path); |
||
| 47 | restore_error_handler(); |
||
| 48 | |||
| 49 | if (false === $content) { |
||
| 50 | throw new \RuntimeException($error); |
||
| 51 | } |
||
| 52 | |||
| 53 | $this->content = $content; |
||
| 54 | } |
||
| 55 | |||
| 56 | return $this->content; |
||
| 57 | } |
||
| 58 | } |
||
| 59 |