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

VAT formatter does not work in fr_FR namespace #1342

Closed
thomasgataly opened this issue Nov 2, 2017 · 11 comments
Closed

VAT formatter does not work in fr_FR namespace #1342

thomasgataly opened this issue Nov 2, 2017 · 11 comments

Comments

@thomasgataly
Copy link

Hello,
The error occurs when I try to use the vat formatter. This formatter use the siren method which does not exists in the class and its parent. This method seems to be defined in the Faker\Provider\fr_FR\Company class.

@raphaeldealmeida
Copy link
Contributor

Hi @thomasngataly

I think VAT is Payment Provider
Give me a code example please

@thomasgataly
Copy link
Author

thomasgataly commented Nov 6, 2017

Hi @raphaeldealmeida

The code inside the VAT method calls an undefined siren method. See the code below

return sprintf("%s%s%s%s", $prefix, self::randomNumber(2, true), $this->siren($spacedNationalPrefix));

@irozgar
Copy link

irozgar commented Nov 9, 2017

Hi

I also have this issue. I've seen that this commit is the one that introduced the change that broke this, because the method siren does not exist in the class Payment for fr_FR locale or in its parent class.

@jocel1
Copy link

jocel1 commented Dec 8, 2017

Hi @raphaeldealmeida ,

Same issue for me, code example to reproduce the issue is simple:

$faker = Factory::create('fr_FR');
echo $faker->vat();

@ppelgrims
Copy link
Contributor

What do you think about making the method static?

    public function vat($spacedNationalPrefix = true)
    {
        $prefix = ($spacedNationalPrefix) ? "FR " : "FR";

-       return sprintf("%s%s%s%s", $prefix, self::randomNumber(2, true), $this->siren($spacedNationalPrefix));
+       return sprintf("%s%s%s%s", $prefix, self::randomNumber(2, true), Company::siren($spacedNationalPrefix));

    }

@fzaninotto
Copy link
Owner

Fixed by #1381

@jdecool
Copy link

jdecool commented Mar 14, 2018

Does this fix will be released soon ?

@ppelgrims
Copy link
Contributor

@jdecool see #1391

@jdecool
Copy link

jdecool commented Mar 14, 2018

Thanks @ppelgrims.

I saw it, but I can't set a dependency point to the master branch, even if it's only required for development.

This issue was fixed nearly 3 months ago...

@ppelgrims
Copy link
Contributor

I don't know what the policy or planning is for releases but I thought that could help you out in the mean time. Can't be of any more help I'm afraid.

@jdecool
Copy link

jdecool commented Mar 14, 2018

No problem @ppelgrims, thanks for the suggestion :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants