You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enhancements to exceptions and BE, LU formatters - #13
Adds getters to exception objects for easier use, for instance for displaying translated error messages to the user on a higher level, then it's nice you can grab just the postcode instead of the total exception message.
Implements a helper trait to strip off Country code prefixes from postalcodes:
In some countries like Belgium or Luxembourg its common to provide a country code prefix in a postalcode, although the format is incorrect, many government agencies, businesses and people still use this. See: https://en.wikipedia.org/wiki/Postal_codes_in_Belgium Rather than failing this format into an exception, this helper class strips the prefix off before validating it, thus providing you with the correct format without the country code prefix in it.
Of course a helper is not necessarily needed, but this prevents duplicate lines of code in the project and allows for other helpers to be shared across formatters.
Adds getters to exception objects for easier use, for instance for displaying translated error messages to the user on a higher level, then it's nice you can grab just the postcode instead of the total exception message.
Implements a helper trait to strip off Country code prefixes from postalcodes:
In some countries like Belgium or Luxembourg its common to provide a country code prefix in a postalcode, although the format is incorrect, many government agencies, businesses and people still use this. See: https://en.wikipedia.org/wiki/Postal_codes_in_Belgium Rather than failing this format into an exception, this helper class strips the prefix off before validating it, thus providing you with the correct format without the country code prefix in it.
Of course a helper is not necessarily needed, but this prevents duplicate lines of code in the project and allows for other helpers to be shared across formatters.
Let me know what you guys think.