sequenceCount > 1) { throw new \LogicException('Only one sequence field is allowed in a structure.'); } if ($this->currentOffset + $field->bits() > 63) { throw new \OverflowException('Total structure size cannot exceed 63 bits.'); } $this->fields[] = $field->setOffset($this->currentOffset); $this->currentOffset += $field->bits(); return $this; } /** * The ID components. * * @return \Zhineng\Snowflake\Component[] */ public function components(): array { return $this->fields; } /** * The total size in bits. */ public function size(): int { return $this->currentOffset; } }