| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function readAll(string $path): string |
||
| 22 | { |
||
| 23 | /** @psalm-suppress InvalidArgument */ |
||
| 24 | $process = proc_open( |
||
| 25 | [ |
||
| 26 | 'cat', |
||
| 27 | $path |
||
| 28 | ], |
||
| 29 | [ |
||
| 30 | 0 => ['pipe', 'r'], |
||
| 31 | 1 => ['pipe', 'w'], |
||
| 32 | 2 => ['pipe', 'w'], |
||
| 33 | ], |
||
| 34 | $pipes |
||
| 35 | ); |
||
| 36 | $contents = stream_get_contents($pipes[1]); |
||
| 37 | proc_close($process); |
||
| 38 | |||
| 39 | return $contents; |
||
| 40 | } |
||
| 42 |