Conditions | 4 |
Paths | 3 |
Total Lines | 7 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
38 | 34 | public static function assertBase64Data(string $value, string $message = ''): void |
|
39 | { |
||
40 | 34 | $binaryData = base64_decode($value, true); |
|
41 | 34 | if (is_bool($binaryData) || 0 === strlen($binaryData)) { |
|
42 | 8 | $format = 0 === strlen($message) ? '%1$s must be base64 encoded' : $message; |
|
43 | 8 | $message = sprintf($format, self::valueToString($value)); |
|
44 | 8 | throw new InvalidArgumentException($message); |
|
45 | } |
||
48 |