brick / money

A money and currency library for PHP
MIT License
1.61k stars 96 forks source link

Support for lowercase currency #74

Open that-guy-iain opened 1 year ago

that-guy-iain commented 1 year ago

There are some APIs that return the currency code in a lowercase. This results in an unknown currency code and a whole bunch of strtoupper calls all over the codebase it makes the code fundamentally fragile if a strtoupper is missed somewhere the code ends up breaking somewhere.

I purpose that Currency::of supports upper and lower case. It would be a lot easier to add a strtoupper there to ensure all codes passed at converted to upper case. Thus isolating this logic that the currency code must be uppercase.