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

In data.json file, the Faker's formatter's options seems to not accept arrays #4

Open
RedLucas opened this issue Jun 6, 2017 · 1 comment

Comments

@RedLucas
Copy link

RedLucas commented Jun 6, 2017

I know there's not many use-cases for this which is probably for why we missed it. If you were to try to use Faker.randomElement(), it uses an array as a parameter. This gives me
Fatal error: Uncaught TypeError: Argument 1 passed to Faker\Provider\Base::randomElements() must be of the type array, string given

I understand why this is happening. Later in the stack trace it's showing me a Faker\Provider\Base::randomElement('array('top', 'left', 'right')'). So I believe that there's some code somewhere that's wrapping these parameters in quotes.... If I get some time I'll try to find it myself.

If there's a rational reason for why this is happening, perhaps we could enforce the newer [] array syntax? So we could not wrap it in quotes (make it a string) if the parameter starts with a '['?

@RedLucas
Copy link
Author

RedLucas commented Jun 6, 2017

Delivered a fix at #5

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

No branches or pull requests

1 participant