Brick Money Versions Save

A money and currency library for PHP

0.9.0

5 months ago

πŸ’₯ Breaking changes

  • Minimum PHP version is now 8.1
  • PDOProviderConfiguration no longer has getters, its properties are public readonly
  • RoundingMode from brick/math is now an enum, so:
    • all methods accepting an int rounding mode now accept a RoundingMode instance instead
    • this should be transparent to your application, as you'll be using the same constants such as RoundingMode::UP

0.8.1

7 months ago

πŸ‘Œ Improvement

Currency now implements JsonSerializable (#79).

Thanks @joelvh!

0.8.0

1 year ago

πŸ’₯ Breaking changes

  • Minimum PHP version is now 8.0
  • Due to Croatia's adoption of the Euro on January 1st, 2023:
    • the HRK currency (Kuna) has been removed from the ISO currency provider
    • the HR country (Croatia) is now mapped to EUR (Euro)
  • PDOProviderConfiguration now has a proper constructor, and its properties are no longer public
  • PDOProviderConfiguration now throws exceptions in the constructor when configuration is invalid
  • All documented union types are now strongly typed:
    • If you have a custom ExchangeRateProvider implementation, you will need to update your getExchangeRate() method signature
    • If you were passing Stringable objects to of() or any of the methods internally calling of(), and have strict_types enabled, you will need to explicitly cast these objects to string first

0.7.1

1 year ago

πŸ‘Œ Improvements

  • Compatibility with brick/math version 0.11

0.7.0

1 year ago

πŸ’₯ Breaking changes

  • JSON extension is now required for PHP 7.4 (always available with PHP >= 8.0)
  • AbstractMoney is now officially sealed, extending it yourself is not supported

✨ New features

  • Money and RationalMoney now implement JsonSerializable

0.6.0

1 year ago

πŸ’₯ Breaking changes

  • Minimum PHP version is now 7.4
  • AbstractMoney::getAmount() now has a return type
  • CurrencyConverter's constructor does not accept a default $context anymore
  • CurrencyConverter::convert() now requires the $context previously accepted by the constructor as third parameter
  • Money::allocateWithRemainder() now refuses to allocate a portion of the amount that cannot be spread over all ratios, and instead adds that amount to the remainder (#55)
  • Money::splitWithRemainder() now behaves like allocateWithRemainder()

✨ New ISO currencies

  • SLE (Leone) in Sierra Leone (SL)

πŸ‘Œ Improvements

  • Compatibility with brick/math version 0.10

0.5.3

2 years ago

✨ Add support for VED (Venezuelan bolívar) currency.

0.5.2

3 years ago

✨ New methods

  • Money::splitWithRemainder()
  • Money::allocateWithRemainder()

These methods perform like their split() and allocate() counterparts, but append the remainder at the end of the returned array instead of spreading it over the first monies.

Thanks @NCatalani!

0.5.1

3 years ago

πŸ‘Œ Improvement

BaseCurrencyProvider now always returns a BigNumber for convenience (#37). This is useful if you're using BaseCurrencyProvider on its own, not just in CurrencyConverter.

Thanks @rdarcy1!

0.5.0

3 years ago

πŸ‘Œ Improvements

  • compatibility with brick/math version 0.9

⚠️ Caution

When using brick/math version 0.9, the Money factory methods such as of() and ofMinor() now accept decimal numbers in the form .123 and 123., and do not throw an exception anymore in this case.