public function add(Money $money)
  {
    if($this->isSameCurrency($money))
    {
      return Money::init($this->cents + $money->cents, $this->currency->getIsoCode());
    }

    throw new InvalidCurrencyException("You can't add two Money objects with different currencies");
  }
public function add(Money $money)
  {
    if($this->isSameCurrency($money))
    {
      return Money::init($this->cents + $money->cents, $this->currency->getIsoCode());
    }

    throw new InvalidCurrencyException("You can't add two Money objects with different currencies");
  }
public function add ( Money $ money ) { if ( $ this -> isSameCurrency ( $ money ) ) { return Money :: init ( $ this -> cents + $ money -> cents , $ this -> currency -> getIsoCode ( ) ) ; } throw new InvalidCurrencyException ( "You can't add two Money objects with different currencies" ) ; }
Add two the value of two Money objects and return a new Money object.

@param PhilipBrown\Money\Money $money
@return PhilipBrown\Money\Money
Add two the value of two Money objects and return a new Money object .