I'm doing the conversion of my codebase from PHP 7.2 to 8.2 and trying to take advantage of any new features i can.
I like the idea of using enums as I've always disliked having to load/parse a whole class just to access (for example) only 1 constant.
However, I'm struggling with the structure of the enum files.
I currently have a simple class Contact which has constants for the state ACTIONED and UNACTIONED.
When someone makes a contact I have constants in the same class for the contact type TYPE_QUERY, TYPE_SUGGESTION, TYPE_COMPLIMENT etc.
In this simple example, an enum equivalent would be:
ContactState (Actioned/Unactioned)
and an enum class for
ContactType (Query,Suggestion, Compliment).
Would this be right? It's just seems a little overkill having 2 files and 1 of them having just 2 values in it?