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

unique() throws depending on generator #856

Closed
nicolaiskogheim opened this issue Mar 19, 2016 · 2 comments
Closed

unique() throws depending on generator #856

nicolaiskogheim opened this issue Mar 19, 2016 · 2 comments

Comments

@nicolaiskogheim
Copy link

This works as expected:

$faker->unique()->words($nb = 3, $asText = true)

This does not:

$faker->unique()->words($nb = 3, $asText = false)

Stacktrace from the latter:

  [ErrorException]                                                                
  array_key_exists(): The first argument should be either a string or an integer  


Exception trace:
 () at /data/vendor/fzaninotto/faker/src/Faker/UniqueGenerator.php:44
 Illuminate\Foundation\Bootstrap\HandleExceptions->handleError() at n/a:n/a
 array_key_exists() at /data/vendor/fzaninotto/faker/src/Faker/UniqueGenerator.php:44

It may be that I just don't understand how unique works, but I was surprised that I got this error.

@fzaninotto
Copy link
Owner

This was already fixed in #749, please test the master branch.

@nicolaiskogheim
Copy link
Author

Sorry, I should've done that. Thanks.

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

No branches or pull requests

2 participants