-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't generate birth number of '000' for Swedish personal identity number #306
Conversation
Missing tests for this |
@pelmered this looks fine once you add the early return mentioned in @powellblyth's reply. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions. |
@bramceulemans |
Still a small change requested. For the rest it looks fine for me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If statements should be type-safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the effort of improving this PR.
@pimjansen what do you think about the suggestions from php-cs-fixer? |
Well not really an opinion though. There are pro and cons for both. But we have the fixer so lets follow it. |
Thanks for the quick fix. |
Thanks for the merge! |
What is the reason for this PR?
Author's checklist
Summary of changes
Swedish personal identity number with a birth number of 000 is not valid. The birth number is the first 3 numbers of the last 4, marked with X here 19900101-XXX0
Note: There are no tests for this. I'm not sure how to test this in a good way as this only happen one time in 1000 on average. Any suggestions for this, or can we skip the test?
Review checklist