src/LocalTime.php
public function withHour(int $hour) : LocalTime
    {
        if ($hour === $this->hour) {
            return $this;
        }

        Field\HourOfDay::check($hour);

        return new LocalTime($hour, $this->minute, $this->second, $this->nano);
    }
public function withHour(int $hour) : LocalTime
    {
        if ($hour === $this->hour) {
            return $this;
        }

        Field\HourOfDay::check($hour);

        return new LocalTime($hour, $this->minute, $this->second, $this->nano);
    }
public function withHour ( int $ hour ) : LocalTime { if ( $ hour === $ this -> hour ) { return $ this ; } Field \ HourOfDay :: check ( $ hour ) ; return new LocalTime ( $ hour , $ this -> minute , $ this -> second , $ this -> nano ) ; }
Returns a copy of this LocalTime with the hour-of-day value altered.

@param int $hour The new hour-of-day.

@return LocalTime

@throws DateTimeException If the hour-of-day if not valid.
Returns a copy of this LocalTime with the hour - of - day value altered .