Пример #1
0
 /**
  * Returns a copy of this LocalDate with the specified period in days added.
  *
  * @param integer $days
  *
  * @return LocalDate
  */
 public function plusDays($days)
 {
     $days = Cast::toInteger($days);
     if ($days === 0) {
         return $this;
     }
     return LocalDate::ofEpochDay($this->toEpochDay() + $days);
 }
Пример #2
0
 /**
  * @dataProvider providerEpochDay
  *
  * @param integer $epochDay The epoch day.
  * @param integer $year     The expected year.
  * @param integer $month    The expected month.
  * @param integer $day      The expected day.
  */
 public function testOfEpochDay($epochDay, $year, $month, $day)
 {
     $this->assertLocalDateIs($year, $month, $day, LocalDate::ofEpochDay($epochDay));
 }