$max) { throw new Compiler\Exception\Rule( 'Cannot repeat with a min (%d) greater than max (%d).', 0, [$min, $max] ); } $this->_min = $min; $this->_max = $max; return; } /** * Get minimum bound. * * @return int */ public function getMin() { return $this->_min; } /** * Get maximum bound. * * @return int */ public function getMax() { return $this->_max; } /** * Check whether the maximum repetition is unbounded. * * @return bool */ public function isInfinite() { return -1 === $this->getMax(); } }