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 pair
    • Converter#convertAgainstCurrencyPair to convert against a currency pair

    ๐Ÿ”„ Changed

    • [BC break] BC Math required as it is the default calculator
    • [BC break] The methods multiply and divide 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