/** * @inheritdoc */ public function minus($amountToSubtract, TemporalUnit $unit) { return ChronoLocalDateImpl::ensureValid($this->getChronology(), parent::minus($amountToSubtract, $unit)); }
/** * Returns a copy of this date-time with the new date and time, checking * to see if a new object is in fact required. * * @param Temporal $newDate the date of the new date-time, not null * @param LocalTime $newTime the time of the new date-time, not null * @return ChronoLocalDateTimeImpl the date-time, not null */ private function _with(Temporal $newDate, LocalTime $newTime) { if ($this->date === $newDate && $this->time === $newTime) { return $this; } // Validate that the new Temporal is a ChronoLocalDate (and not something else) $cd = ChronoLocalDateImpl::ensureValid($this->date->getChronology(), $newDate); return new ChronoLocalDateTimeImpl($cd, $newTime); }