/** * @throws WrongArgumentException * @return Range **/ public function setMax($max = null) { if ($max !== null) { Assert::isInteger($max); } else { return $this; } return parent::setMax($max); }
public function intersects(BaseRange $range) { return $this->max >= $range->getMin() && $this->min <= $range->getMax(); }
private function checkLimits(BaseRange $range) { if (!($this->min && $range->getMin() && $range->getMin() < $this->min) && !($this->max && $range->getMax() && $range->getMax() > $this->max)) { return true; } return false; }