コード例 #1
0
ファイル: Money.php プロジェクト: Nilz11/money
 /**
  * @inheritdoc
  */
 public function isSameCurrency(Money $money)
 {
     if ($this->getCurrency()->getAlpha3() !== $money->getCurrency()->getAlpha3()) {
         return false;
     }
     return true;
 }
コード例 #2
0
ファイル: PriceTag.php プロジェクト: Nilz11/money
 /**
  * Gets tax value between net and gross price
  * @return Money
  */
 public function getTaxValue()
 {
     return $this->grossPrice->subtract($this->netPrice);
 }
コード例 #3
0
ファイル: MoneyTest.php プロジェクト: Nilz11/money
 /**
  * @dataProvider getCurrencyMismatchData
  * @expectedException \Nilz\Money\Exception\CurrencyMismatchException
  */
 public function testCompareToWithDifferentCurrenciesFails(Money $base, Money $compareObject)
 {
     $base->compareTo($compareObject);
 }