reducktion / socrates

PHP package to Validate and Extract information from National Identification Numbers.
MIT License
47 stars 4 forks source link

[v1.3.0] Improve PHPDoc on InvalidLengthException #102

Closed AlexOlival closed 3 years ago

AlexOlival commented 3 years ago

InvalidLengthException is a good example of am internal exception with a nice DX for people contributing to the codebase. Clearly, our recent contributors know how to use it: https://github.com/reducktion/socrates/blob/4b6174df1e2e62091ed787e0dd2f23c953a383be/src/Core/SouthAmerica/Peru/PeruIdValidator.php#L65

We can go a bit further though and document the constructor with each parameter being described in the constructor, rather than what we have now:

https://github.com/reducktion/socrates/blob/1278365b26451cb75bd5e4d703121dc6efeac492/src/Exceptions/InvalidLengthException.php#L28-L35

Additionally, we don't need a $designation field in the class, as it is not being used anywhere else.