FakerPHP / Faker

Faker is a PHP library that generates fake data for you
https://fakerphp.github.io
Other
3.48k stars 332 forks source link

Enhancement: Configure `random_api_migration` fixer #692

Closed localheinz closed 10 months ago

localheinz commented 10 months ago

What is the reason for this PR?

Author's checklist

Summary of changes

Review checklist

bram-pkg commented 10 months ago

Wouldn't this break mt_seed?

localheinz commented 10 months ago

@bram-pkg

I think the entire randomization needs a bit of rework!

Given that randomization is infrastructure (similar to a clock), I think it makes sense to abstract it away. Then we can change the internal implementation to whatever makes the most sense, and eventually migrate away towards https://www.php.net/manual/en/class.random-randomizer.php.

What do you think?

bram-pkg commented 10 months ago

@bram-pkg

I think the entire randomization needs a bit of rework!

Given that randomization is infrastructure (similar to a clock), I think it makes sense to abstract it away. Then we can change the internal implementation to whatever makes the most sense, and eventually migrate away towards https://www.php.net/manual/en/class.random-randomizer.php.

What do you think?

Sounds perfect to bind an instance of that class to our container, so we can resolve the randomiser from anywhere.