63) { throw new \InvalidArgumentException('Bits must be between 1 and 63.'); } } /** * The bit size. */ public function bits(): int { return $this->bits; } /** * The maximum value based on the number of bits. */ public function maxValue(): int { return (1 << $this->bits) - 1; } /** * Set the bit offset. */ public function setOffset(int $offset): static { $this->offset = $offset; return $this; } /** * The bit offset. */ public function offset(): int { return $this->offset; } abstract public function value(): int; }