thephpleague / factory-muffin

Enables the rapid creation of objects for testing
https://factory-muffin.thephpleague.com/
MIT License
531 stars 72 forks source link

Adds support for setting model attributes through setters #405

Closed luiz-brandao closed 8 years ago

luiz-brandao commented 8 years ago

Some model attributes needs to be set through setter methods, but FactoryMuffin only sets the attributes directly. This fix checks for the presence of a setter method on the model and calls it instead. I also included a camelize function. It could possibly be refactored to another class.

luiz-brandao commented 8 years ago

Clearly I'm having troubles getting the code style right... PhpStorm doesn't seem to follow the same rules as the one you setup at StyleCI. Let me know if it's too bad!

GrahamCampbell commented 8 years ago

Please could you revert all changes to the phpdoc of the other methods.

GrahamCampbell commented 8 years ago

Infact, just apply this diff with git apply: https://styleci.io/analyses/Xa9WoX/diff. It'll save you time.

luiz-brandao commented 8 years ago

Finally! Seems everything is following the standard now. Sorry for this mess of commits.

GrahamCampbell commented 8 years ago

Nearly done. Please make the method static and address the other minor cs issues, and squash to one commit, and I'll merge this. If you don't want to squash, let me know, and I can squash on merge.

luiz-brandao commented 8 years ago

Closing this. I made a new clean one.