-
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
[en_GB] VAT number faker #255
Conversation
src/Faker/Provider/en_GB/Company.php
Outdated
return sprintf( | ||
'%s%d %d %d %d', | ||
static::VAT_PREFIX, | ||
static::randomNumber(3, true), |
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.
This only produces numbers bigger than 100. Is that on purpose? If not you could use the str_pad
solution from below here too. The other cases that use randomNumber
have the same issue.
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.
Personally I'd rather stick with the simpler randomNumber()
generator where possible. If I was wanting to test the behaviour of numbers with leading zeros I would use a defined value rather than faking it.
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.
You could also use static::numerify('### #### ## ###')
.
Co-authored-by: Daniel Schmelz <daniel@schmelz.org>
I re-read the Wikipedia notes about this and have subsequently re-worked things a bit. Numbers are now much more likely to pass validation checks and hopefully some of the other issues raised have gone away. |
Thank you |
What is the reason for this PR?
Author's checklist
Summary of changes
en_GB\Company
provider to fake VAT numbersReview checklist