コード例 #1
0
ファイル: Money.php プロジェクト: brick/money
 /**
  * Compares this Money to the given Money.
  *
  * @param Money $that
  *
  * @return int [-1, 0, 1] if `$this` is less than, equal to, or greater than `$that`.
  *
  * @throws CurrencyMismatchException If the given Money is in a different currency.
  */
 public function compareTo(Money $that)
 {
     $this->checkMoney($that);
     return $this->amount->compareTo($that->amount);
 }