Example #1
0
 /**
  * Returns a copy of this LocalDate with the specified Period added.
  *
  * @param Period $period
  *
  * @return LocalDate
  */
 public function plusPeriod(Period $period)
 {
     return $this->plusYears($period->getYears())->plusMonths($period->getMonths())->plusDays($period->getDays());
 }
Example #2
0
 /**
  * @param integer $years  The expected number of years in the period.
  * @param integer $months The expected number of months in the period.
  * @param integer $days   The expected number of days in the period.
  * @param Period  $period The period to test.
  */
 protected function assertPeriodIs($years, $months, $days, Period $period)
 {
     $this->compare([$years, $months, $days], [$period->getYears(), $period->getMonths(), $period->getDays()]);
 }