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