DEV Community

Discussion on: Keeping (large) data providers organized in PHPUnit

Collapse
 
erikbooij profile image
Erik Booij

Hi Tomáš, I must admit that I haven't given generators in data providers much thought yet, so it's at least a welcome new perspective.

As of yet, I don't see any real clear advantages of generators over plain old arrays though. Syntax is a bit different and one might argue that a yield looks a bit cleaner, whereas one might also argue that more developers are likely to be familiar with arrays than generators, which might help collaboration. Am I missing some benefits?

Thanks for the Rector hint. I hadn't heard of it before and will give it a chance for sure 👌