src/Domain/Value/Money/Money.php
public function subtract(Money $other): Money
    {
        $this->guardCurrency($other);

        $amount = $this->amount - $other->amount;

        $this->guardAmountInBounds($amount);

        return $this->withAmount($amount);
    }
public function subtract(Money $other): Money
    {
        $this->guardCurrency($other);

        $amount = $this->amount - $other->amount;

        $this->guardAmountInBounds($amount);

        return $this->withAmount($amount);
    }
public function subtract ( Money $ other ) : Money { $ this -> guardCurrency ( $ other ) ; $ amount = $ this -> amount - $ other -> amount ; $ this -> guardAmountInBounds ( $ amount ) ; return $ this -> withAmount ( $ amount ) ; }
Creates instance that subtracts the given monetary value

@param Money $other The other monetary value

@return Money

@throws DomainException When other has different currency
@throws RangeException When integer overflow occurs
Creates instance that subtracts the given monetary value