예제 #1
0
 /**
  * @param CalendarDate|Object $start
  * @param CalendarDate|HasClassName $end
  */
 protected function __construct(CalendarDate $start, CalendarDate $end)
 {
     if (!$end->sameTypeAs($start)) {
         throw new NotMatchTypeException($end);
     }
     if ($end->earlierThan($start)) {
         throw new InvalidArgumentException(sprintf('%s must be later then %s', '$end', '$start'));
     }
     $this->start = $start;
     $this->end = $end;
 }