src/LocalTime.php
public function plusHours(int $hours) : LocalTime
    {
        if ($hours === 0) {
            return $this;
        }

        $hour = (($hours % self::HOURS_PER_DAY) + $this->hour + self::HOURS_PER_DAY) % self::HOURS_PER_DAY;

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

        $hour = (($hours % self::HOURS_PER_DAY) + $this->hour + self::HOURS_PER_DAY) % self::HOURS_PER_DAY;

        return new LocalTime($hour, $this->minute, $this->second, $this->nano);
    }
public function plusHours ( int $ hours ) : LocalTime { if ( $ hours === 0 ) { return $ this ; } $ hour = ( ( $ hours % self :: HOURS_PER_DAY ) + $ this -> hour + self :: HOURS_PER_DAY ) % self :: HOURS_PER_DAY ; return new LocalTime ( $ hour , $ this -> minute , $ this -> second , $ this -> nano ) ; }
Returns a copy of this LocalTime with the specified period in hours added.

This adds the specified number of hours to this time, returning a new time.
The calculation wraps around midnight.

This instance is immutable and unaffected by this method call.

@param int $hours The hours to add, may be negative.

@return LocalTime A LocalTime based on this time with the hours added.
Returns a copy of this LocalTime with the specified period in hours added .