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

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

        if ($nanos !== 0) {
            $nanos = LocalTime::NANOS_PER_SECOND - $nanos;
            $seconds--;
        }

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

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

        if ($nanos !== 0) {
            $nanos = LocalTime::NANOS_PER_SECOND - $nanos;
            $seconds--;
        }

        return new Duration($seconds, $nanos);
    }
public function negated ( ) : Duration { if ( $ this -> isZero ( ) ) { return $ this ; } $ seconds = - $ this -> seconds ; $ nanos = $ this -> nanos ; if ( $ nanos !== 0 ) { $ nanos = LocalTime :: NANOS_PER_SECOND - $ nanos ; $ seconds -- ; } return new Duration ( $ seconds , $ nanos ) ; }
Returns a copy of this Duration with the length negated.

@return \Brick\DateTime\Duration
Returns a copy of this Duration with the length negated .