Money v4.0.0 Release Notes
Release Date: 2021-05-17 // almost 3 years ago-
โ Added
- PHP8.0 compatibility (#633 and #619)
- Recommendation to use a type-checker like psalm or phpstan
- Rounding to units
Converter#convertAndReturnWithCurrencyPair
to get the combination of the converted money and currency pairConverter#convertAgainstCurrencyPair
to convert against a currency pair
๐ Changed
- [BC break] BC Math required as it is the default calculator
- [BC break] The methods
multiply
anddivide
do not accept floating points any more. Callers are required to convert a float to string (e.g.sprintf('%.14F', $float)
) before calling these methods. - [BC break] The constructor of the
FixedExchange
does not accept floating points any more. Callers are required to ๐จ convert a float to string (e.g.sprintf('%.14F', $float)
) before calling the constructor. - ๐ Allow multiple arguments to
Money#isSameCurrency
- ๐ Renamed second parameter of
Parser#parse
to$fallbackCurrency
๐ Fixed
- ๐ Fix GMP multiply and divide by negative (#640 #626)
- Currency code must be uppercase (#639 #638 #637)
- The CPU no longer overheats when using this library (#634)
- No longer allowing null amount (#615)
- โก๏ธ Update cached currencies (#583)
- Only numeric strings allowed (#575)
- Calculator and Number are internal (#465)
- Negative ratio in
Money#allocate()
is now allowed (#258)
โ Removed
- [BC break] Removed PhpCalculator
- [BC break] Removed
Currency#isAvailableWithin()
- [BC break] Removed string as allowed parameter for
MoneyParser#parse
- [BC break] Completely remove float usage, methods now return numeric-strings