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

        $mofd = $this->hour * self::MINUTES_PER_HOUR + $this->minute;
        $newMofd = (($minutes % self::MINUTES_PER_DAY) + $mofd + self::MINUTES_PER_DAY) % self::MINUTES_PER_DAY;

        if ($mofd === $newMofd) {
            return $this;
        }

        $hour = \intdiv($newMofd, self::MINUTES_PER_HOUR);
        $minute = $newMofd % self::MINUTES_PER_HOUR;

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

        $mofd = $this->hour * self::MINUTES_PER_HOUR + $this->minute;
        $newMofd = (($minutes % self::MINUTES_PER_DAY) + $mofd + self::MINUTES_PER_DAY) % self::MINUTES_PER_DAY;

        if ($mofd === $newMofd) {
            return $this;
        }

        $hour = \intdiv($newMofd, self::MINUTES_PER_HOUR);
        $minute = $newMofd % self::MINUTES_PER_HOUR;

        return new LocalTime($hour, $minute, $this->second, $this->nano);
    }
public function plusMinutes ( int $ minutes ) : LocalTime { if ( $ minutes === 0 ) { return $ this ; } $ mofd = $ this -> hour * self :: MINUTES_PER_HOUR + $ this -> minute ; $ newMofd = ( ( $ minutes % self :: MINUTES_PER_DAY ) + $ mofd + self :: MINUTES_PER_DAY ) % self :: MINUTES_PER_DAY ; if ( $ mofd === $ newMofd ) { return $ this ; } $ hour = \ intdiv ( $ newMofd , self :: MINUTES_PER_HOUR ) ; $ minute = $ newMofd % self :: MINUTES_PER_HOUR ; return new LocalTime ( $ hour , $ minute , $ this -> second , $ this -> nano ) ; }
Returns a copy of this LocalTime with the specified period in minutes added.

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

This instance is immutable and unaffected by this method call.

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

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