Skip to content

v4.0.0

Compare
Choose a tag to compare
@PostScripton PostScripton released this 22 Jan 17:17
· 19 commits to 4.x since this release
0013b64

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 to multiply() in Money class (#65)
  • Objects manipulate with other objects, not numbers (#66)
  • Raising precision (#70)
  • Renamed Money::make() to Money::of() (#78)
  • equals() is now comparing amounts and currencies with the strict mode on (#79)
  • getCurrency() and setCurrency() have been moved to Money 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() to Currency::getConfigCurrencyCode() (564a7f2)
  • Accept strings as currencies in most places (b8f1d05)
  • Renamed isEmpty() to isZero() in Money class (#122)
  • Nest settings that are related to formatting to the corresponding key in the config file (#128)
  • Refactored Services to RateExchangers (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, and CurrencyPosition enums (#91)
  • absolute() method (#107)
  • money_parse() helper function (#109)
  • BcMath for calculations (#118)
  • Currency::get() and Currency::getOrDefault() (917c98e)
  • Currencies::same() checks that all passed currencies are the same (#124)
  • isDifferentCurrency() as negative version of isSameCurrency() (#127)

Full Changelog: v3.2.4...v4.0.0