コード例 #1
0
 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;
 }
コード例 #2
0
 /**
  * @throws WrongArgumentException
  * @return Range
  **/
 public function setMax($max = null)
 {
     if ($max !== null) {
         Assert::isInteger($max);
     } else {
         return $this;
     }
     return parent::setMax($max);
 }
コード例 #3
0
 public function intersects(BaseRange $range)
 {
     return $this->max >= $range->getMin() && $this->min <= $range->getMax();
 }