PHP: My approach to saving Enum data values
Let me make a custom class to save them.
After reading Salar’s way to “save” enum values, I decided to make my own way to save Enum values through a class called Enumerate
.
The main task of an Enumerate
instance is to allow to be set a valid state from a given list. If the state is not in the list, an Exception should be thrown because…