| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.0116 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | 1 | public function __toString(): string |
|
| 32 | { |
||
| 33 | 1 | $file = tmpfile(); |
|
| 34 | |||
| 35 | 1 | if (false === $file) { |
|
| 36 | throw new Exception('Unable to generate temporary tmp file.'); |
||
| 37 | } |
||
| 38 | |||
| 39 | 1 | $path = stream_get_meta_data($file)['uri']; |
|
| 40 | |||
| 41 | 1 | $this->toFile($path)->save(); |
|
| 42 | |||
| 43 | 1 | return (string) file_get_contents($path); |
|
| 44 | } |
||
| 71 |