Improvement maybe: Fill any object you want.
didslm opened this issue · 0 comments
didslm commented
Summary
I already did something in my project where it uses faker to fill objects and tries to guess the format if not it goes by the input type (int|string|bool) it works even with custom object.
There is already something inside for Doctrine entities but I couldn't find it for objects with some setters.
Btw this works only if the object has setters.
Self-enclosed code snippet for reproduction
To use it you just provide the object and it will fill it.
Example
$faker->fillObject($someObject, FILL_OPTIONAL_PARAMETERS);