firstSector = $firstSector; if($sectorCount < 0 or $sectorCount > 255){ throw new \InvalidArgumentException("Sector count must be in range 0...255, got $sectorCount"); } $this->sectorCount = $sectorCount; $this->timestamp = $timestamp; } /** * @return int */ public function getFirstSector() : int{ return $this->firstSector; } /** * @return int */ public function getLastSector() : int{ return $this->firstSector + $this->sectorCount - 1; } /** * Returns an array of sector offsets reserved by this chunk. * @return int[] */ public function getUsedSectors() : array{ return range($this->getFirstSector(), $this->getLastSector()); } /** * @return int */ public function getSectorCount() : int{ return $this->sectorCount; } /** * @return int */ public function getTimestamp() : int{ return $this->timestamp; } /** * @return bool */ public function isNull() : bool{ return $this->firstSector === 0 or $this->sectorCount === 0; } }