Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
46 | protected static function readFile(string $file): string |
||
47 | { |
||
48 | $length = filesize($file); |
||
49 | |||
50 | if (!($fd = fopen($file, 'rb'))) { |
||
51 | throw new Exception("Cannot read the file '$file', probably permissions"); |
||
52 | } |
||
53 | |||
54 | $content = $length ? fread($fd, $length) : ''; |
||
55 | fclose($fd); |
||
56 | |||
57 | return $content; |
||
58 | } |
||
59 | } |
||
60 |