Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

+1 VAT Provider w/ 40+ countries rules, fix #591 #594

Closed
wants to merge 8 commits into from

Conversation

ronanguilloux
Copy link
Contributor

I had to handle backward compatibility on

  • src/Faker/Provider/at_AT/Payment.php, vatmethod
  • src/Faker/Provider/bg_BG/Payment.php, vatmethod

I propose to tag them as @deprecated. Existing unit tests are maintained.

@ronanguilloux
Copy link
Contributor Author

May fix #591 too

* @link http://en.wikipedia.org/wiki/VAT_identification_number
* @link https://github.com/ronanguilloux/IsoCodes/blob/master/src/IsoCodes/Vat.php
*/
public static $patterns = array(
Copy link
Owner

Choose a reason for hiding this comment

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

variable name is too generic IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true!

@ronanguilloux
Copy link
Contributor Author

@nineinchnick
Copy link
Contributor

This supersedes the taxpayerIdentificationNumber() method from src/Faker/Provider/pl_PL/Payment.php.

@okj579 okj579 mentioned this pull request Jun 15, 2015
@nineinchnick
Copy link
Contributor

This generator looks similar to iban. Maybe a similar countries format can be used instead of regexps?

@nineinchnick nineinchnick mentioned this pull request Jul 31, 2015
*/
public static function vat($spacedNationalPrefix = true, $country = null)
{
$country = is_null($country) ? array_rand(self::$countryPatterns) : $country;
Copy link
Owner

Choose a reason for hiding this comment

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

array_rand() doesn't use the Mersenne Twister and therefore isn't seedable. Use Faker::randomElement() instead.

@nineinchnick
Copy link
Contributor

Could I somehow help @ronanguilloux with this PR? I'd like to see it merged.

@ronanguilloux
Copy link
Contributor Author

Hi @nineinchnick, sure of course.

I've been too busy lately to continue this PR, but feel free to fork my ronanguilloux:VAT-anyone branch and add your own contrib, and then re-PR to the main Faker repo right from your fork. No need to credit my part of it.

@nineinchnick nineinchnick mentioned this pull request Sep 11, 2015
@fzaninotto
Copy link
Owner

Abandoned, closing.

@fzaninotto fzaninotto closed this Apr 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants