| Conditions | 1 |
| Paths | 1 |
| Total Lines | 8 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 74 | 1 | public function convert(Money $money, Currency $to, $roundingMode = PHP_ROUND_HALF_UP) |
|
| 75 | { |
||
| 76 | 1 | $new = new Money($money->getAmount(), $to); |
|
| 77 | |||
| 78 | 1 | $conversionRate = $this->source->getRateBetween($money->getCurrency(), $to); |
|
| 79 | |||
| 80 | 1 | return $new->multiply($conversionRate, $roundingMode); |
|
| 81 | } |
||
| 82 | } |
||
| 83 |