36 $this->validate($total, $current);
37 $this->total = $total;
38 $this->current = $current;
48 $this->validate($this->total, $this->current + 1);
59 $this->current = $this->total;
69 return $this->current;
89 return $this->current / $this->total;
100 private function validate($total, $current)
102 if (empty($total) || 0 >= $total) {
103 throw new \LogicException(
'Total number must be more than zero.');
105 if ($current > $total) {
106 throw new \LogicException(
'Current cannot exceed total number.');
__construct($total, $current=0)