Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2.032 |
Changes | 3 | ||
Bugs | 2 | Features | 0 |
1 | <?php |
||
8668 | 2 | public static function str_to_binary(string $str) |
|
8669 | { |
||
8670 | /** @var array|false $value - needed for PhpStan (stubs error) */ |
||
8671 | 2 | $value = \unpack('H*', $str); |
|
8672 | 2 | if ($value === false) { |
|
8673 | return false; |
||
8674 | } |
||
8675 | |||
8676 | /** @noinspection OffsetOperationsInspection */ |
||
8677 | 2 | return \base_convert($value[1], 16, 2); |
|
8678 | } |
||
13689 |