This PR adds a new method called tryParse that doesn't throw an exception, instead it returns a bool. It also fixes the samples in the README on How to use the Utility CodiceFiscale class to correspond to the actual behavior of the CodiceFiscale class.
Fixes #43
Please check if the documentation is good like this or if I have to change something.
Motivation and context
It simplifies some cases, for example when using it in a blade view:
Before:
Description
This PR adds a new method called
tryParse
that doesn't throw an exception, instead it returns a bool. It also fixes the samples in the README on How to use the Utility CodiceFiscale class to correspond to the actual behavior of theCodiceFiscale
class. Fixes #43 Please check if the documentation is good like this or if I have to change something.Motivation and context
It simplifies some cases, for example when using it in a blade view: Before:
After:
How has this been tested?
I have added 2 tests to test the new method
Screenshots (if appropriate)
Types of changes
What types of changes does your code introduce? Put an
x
in all the boxes that apply:Checklist: