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.
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 astrtoupper
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 astrtoupper
there to ensure all codes passed at converted to upper case. Thus isolating this logic that the currency code must be uppercase.