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

Formatters are not reset when adding a new provider #366

Closed
singleseeker opened this issue Aug 28, 2021 · 2 comments · Fixed by #386
Closed

Formatters are not reset when adding a new provider #366

singleseeker opened this issue Aug 28, 2021 · 2 comments · Fixed by #386
Labels
bug Something isn't working

Comments

@singleseeker
Copy link

Summary

After using addProvider method, get a weird result

Versions

Version
PHP 7.4.13
fakerphp/faker 1.15.0
use Faker\Provider\en_US\Person;
use Faker\Provider\zh_CN\Person as Zh_CNPerson;

// =============================

$this->faker->addProvider(new Person($this->faker));

dump($this->faker->lastName() . ' ' . $this->faker->firstName());

$this->faker->addProvider(new Zh_CNPerson($this->faker));

dd($this->faker->lastName() . ' ' . $this->faker->firstName());

sometimes, you may hope to use different names, with addProvider method, get a weird result.

"Kerluke Lexie"
"Turner 杨"
@FakerPHP FakerPHP deleted a comment from stale bot Sep 12, 2021
@stale stale bot removed the lifecycle/stale label Sep 12, 2021
@stale
Copy link

stale bot commented Sep 26, 2021

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.

@stale stale bot closed this as completed Oct 3, 2021
@bram-pkg
Copy link
Member

bram-pkg commented Oct 3, 2021

What happens when you run this multiple times?

@bram-pkg bram-pkg reopened this Oct 3, 2021
@stale stale bot removed the lifecycle/stale label Oct 3, 2021
@aanfarhan aanfarhan added the bug Something isn't working label Nov 2, 2021
@localheinz localheinz removed the pinned label Dec 21, 2021
@localheinz localheinz changed the title Addprovider didnot return the right result Formatters are not reset when a new provider is added Dec 21, 2021
@localheinz localheinz changed the title Formatters are not reset when a new provider is added Formatters are not reset when adding a new provider Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants