This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
38
{
39
3
if ($locale === null) {
40
$locale = $this->locale;
41
}
42
43
3
$numberFormatter = new \NumberFormatter($locale, \NumberFormatter::DECIMAL);
44
3
$moneyFormatter = new IntlMoneyFormatter($numberFormatter, new ISOCurrencies());
45
46
3
return $moneyFormatter->format($money);
47
}
48
49
/**
50
* localized format for money with the NumberFormatter class in Currency mode
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
59
{
60
9
if ($locale === null) {
61
3
$locale = $this->locale;
62
1
}
63
64
9
$numberFormatter = new \NumberFormatter($locale, \NumberFormatter::CURRENCY);
65
9
$moneyFormatter = new IntlMoneyFormatter($numberFormatter, new ISOCurrencies());
66
67
9
return $moneyFormatter->format($money);
68
}
69
70
/**
71
* gets currency symbol
72
*
73
* @param Money $money
74
* @return null|string
75
*/
76
6
public function formatCurrencyAsSymbol(Money $money)
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.