| Total Complexity | 4 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | final class UInt64 |
||
| 21 | { |
||
| 22 | public int $hi; |
||
| 23 | public int $lo; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * UInt64 constructor. |
||
| 27 | * @param int $hi |
||
| 28 | * @param int $lo |
||
| 29 | */ |
||
| 30 | public function __construct(int $hi, int $lo) |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return string |
||
| 38 | */ |
||
| 39 | public function __toString() |
||
| 40 | { |
||
| 41 | $hi_hex = str_pad(base_convert((string)$this->hi, 10, 16), 8, '0', STR_PAD_LEFT); |
||
| 42 | $lo_hex = str_pad(base_convert((string)$this->lo, 10, 16), 8, '0', STR_PAD_LEFT); |
||
| 43 | return base_convert($hi_hex . $lo_hex, 16, 10); |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * do the wrong thing |
||
| 48 | * |
||
| 49 | * @return int |
||
| 50 | */ |
||
| 51 | public function toInt(): int |
||
| 52 | { |
||
| 53 | return (int)(string)$this; |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @param int $bit_pos |
||
| 58 | * @return bool |
||
| 59 | */ |
||
| 60 | public function checkBitSet(int $bit_pos): bool |
||
| 64 | } |
||
| 65 | } |
||
| 66 |