Commit

7ff45ad

am i crazy or are #php backed enums the factory pattern with a little extra spice? i think i would be displeased by prefixing my factories with the enum keyword though. anyone do this? tell me more.
I don't see the problem if it's for creating simple instances. For example, I've used it for deciding which event to fire. But for factories with a lot of decency injections I'd stick to a proper factory.
yeah, that make sense. I feel like if there are two ways to do achieve the same result, it might be better to stick with the option that is obvious and has the most flexibility, specifically with a large app that is constantly growing and others maintain. i could see it becoming a hassle to stumble upon an enum that is doing something other than what it was intended to do. i already try to stay away from esoteric patterns and terse code for my own future sanity and other maintainers. so it’s unlikely i would adopt enums for factories. but i found it very interesting that they share so much in common! if it was a one-off project i had no intention of maintaining, i might reach for it, for fun.

commit 7ff45ad