Пример #1
0
 private function addRange(Range $range)
 {
     $ranges = $this->ranges;
     foreach ($ranges as $band) {
         if ($range->overlaps($band)) {
             throw new \OutOfBoundsException("Ranges cannot overlap, ({$band}) ({$range})");
         }
     }
     $ranges[] = $range;
     @usort($ranges, array($this, 'sort'));
     $this->ranges = $ranges;
 }
 public function startsBefore(Range $range)
 {
     return Comparable::LESS_THAN == $this->compare($range->getStart());
 }