src/Duration.php
public function plus(Duration $duration) : Duration
    {
        if ($duration->isZero()) {
            return $this;
        }

        $seconds = $this->seconds + $duration->seconds;
        $nanos = $this->nanos + $duration->nanos;

        if ($nanos >= LocalTime::NANOS_PER_SECOND) {
            $nanos -= LocalTime::NANOS_PER_SECOND;
            $seconds++;
        }

        return new Duration($seconds, $nanos);
    }
public function plus(Duration $duration) : Duration
    {
        if ($duration->isZero()) {
            return $this;
        }

        $seconds = $this->seconds + $duration->seconds;
        $nanos = $this->nanos + $duration->nanos;

        if ($nanos >= LocalTime::NANOS_PER_SECOND) {
            $nanos -= LocalTime::NANOS_PER_SECOND;
            $seconds++;
        }

        return new Duration($seconds, $nanos);
    }
public function plus ( Duration $ duration ) : Duration { if ( $ duration -> isZero ( ) ) { return $ this ; } $ seconds = $ this -> seconds + $ duration -> seconds ; $ nanos = $ this -> nanos + $ duration -> nanos ; if ( $ nanos >= LocalTime :: NANOS_PER_SECOND ) { $ nanos -= LocalTime :: NANOS_PER_SECOND ; $ seconds ++ ; } return new Duration ( $ seconds , $ nanos ) ; }
Returns a copy of this Duration with the specified duration added.

@param \Brick\DateTime\Duration $duration

@return \Brick\DateTime\Duration
Returns a copy of this Duration with the specified duration added .