| Conditions | 3 |
| Paths | 4 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 39 | 4 | public static function write(string $filename, string $binaryData, bool $base64Encoded = false): bool |
|
| 40 | { |
||
| 41 | 4 | if ($base64Encoded) { |
|
| 42 | 2 | $binaryData = base64_decode($binaryData, true); |
|
| 43 | 2 | assert(is_string($binaryData)); |
|
| 44 | } |
||
| 45 | |||
| 46 | 4 | $result = file_put_contents($filename, $binaryData); |
|
| 47 | |||
| 48 | 4 | return is_int($result) && 0 < $result; |
|
| 49 | } |
||
| 51 |