Skip to content
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

Added barcode extension to core #252

Merged
merged 2 commits into from
Jan 7, 2021
Merged

Conversation

krsriq
Copy link

@krsriq krsriq commented Jan 7, 2021

What is the reason for this PR?

Barcode extension is not yet in core.

  • A new feature

Author's checklist

Summary of changes

Like #232 only for barcodes - added barcode extension to core.

Review checklist

  • All checks have passed
  • Changes are approved by maintainer

src/Faker/Core/Barcode.php Outdated Show resolved Hide resolved
{
$code = Extension\Helper::numerify(str_repeat('#', $length - 1));

return $code . \Faker\Calculator\Ean::checksum($code);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I maybe would have done this with sprintf to keep it more readable and a bit more secure overall.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed this now.

@pimjansen
Copy link

Thanks! Left some small comments but overall it looks good to me 👍

@pimjansen pimjansen closed this Jan 7, 2021
@pimjansen pimjansen reopened this Jan 7, 2021
@pimjansen
Copy link

^^ Wrong button sorry

@pimjansen pimjansen added the enhancement New feature or request label Jan 7, 2021
@pimjansen pimjansen merged commit 3e61d56 into FakerPHP:main Jan 7, 2021
@pimjansen
Copy link

Thanks

@krsriq
Copy link
Author

krsriq commented Jan 7, 2021

Thanks @pimjansen!

krsriq added a commit to krsriq/Faker that referenced this pull request Jan 7, 2021
* add barcode to core

* add barcode to core
@krsriq krsriq deleted the barcode_core branch January 7, 2021 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants