v4.0.0
Version 4 is out 🎉🎊
It's been a long time since the last major version. We've been using version 3 a lot, however, I've had enough time to reconsider and refactor the vast majority of functionality. Here are the changes:
Changed
- Minimum PHP version is now
8.1
(#64) - Minimum Guzzle version is now
7.5
(40005b0) - Renamed
multiple()
method tomultiply()
inMoney
class (#65) - Objects manipulate with other objects, not numbers (#66)
- Raising precision (#70)
- Renamed
Money::make()
toMoney::of()
(#78) equals()
is now comparing amounts and currencies with the strict mode on (#79)getCurrency()
andsetCurrency()
have been moved toMoney
class (#86)- New
Currencies
class to work with collections of currencies (#93) - Reworked parser (#97)
- Most exceptions have been refactored (#102, #139)
difference()
method now returns an absolute Money object, not a string (#106)- Renamed
Currency::getConfigCurrency()
toCurrency::getConfigCurrencyCode()
(564a7f2) - Accept strings as currencies in most places (b8f1d05)
- Renamed
isEmpty()
toisZero()
inMoney
class (#122) - Nest settings that are related to formatting to the corresponding key in the config file (#128)
- Refactored
Services
toRateExchangers
(ExchangeRatesAPI has been replaced with Fixer as well) (#130)
Removed
MoneySettings
have gone (#114)- Currency list methods (#90)
Currency::getConfigCurrency()
(564a7f2, a0a9296)
Fixed
- Custom currencies from the config file should override pre-defined currencies (#87)
- Cast to null no longer causes the error (#104)
Added
- Formatters in replacement of
MoneySettings
(#114) CurrencyList
,CurrencyPosition
, andCurrencyPosition
enums (#91)absolute()
method (#107)money_parse()
helper function (#109)- BcMath for calculations (#118)
Currency::get()
andCurrency::getOrDefault()
(917c98e)Currencies::same()
checks that all passed currencies are the same (#124)isDifferentCurrency()
as negative version ofisSameCurrency()
(#127)
Full Changelog: v3.2.4...v4.0.0