public function __construct(Coordinate $from, Coordinate $to) { if ($from->compareTo($to) !== 1) { throw new InvalidCellRangeException(); } $this->from = $from; $this->to = $to; $this->rewind(); }