Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | 58 | public static function read(string $filename, bool $base64Encode = false): string |
|
24 | { |
||
25 | 58 | $binaryData = file_get_contents($filename); |
|
26 | 58 | assert(is_string($binaryData)); |
|
27 | |||
28 | 58 | if ($base64Encode) { |
|
29 | 54 | $binaryData = base64_encode($binaryData); |
|
30 | } |
||
31 | |||
32 | 58 | return $binaryData; |
|
33 | } |
||
51 |