Closed marc-mabe closed 11 years ago
setOrdinal() for setting by position? not really ;-)
$enum->setValueByOrdinal(2) - does that sound better? not really again.
On the other hand, I am thinking about removing the setValue and setName methods, too. An enum should be immortal. If you need another one, create a new enum.
After some considerations I agree with you. an enum itself defines a value and it that value is modifiable it could be much harder for other to detect changes because the object itself didn't change.
So I agree for removing setters ... I will create an issue
as noted in #1
It should be possible to change the value by it's enum position - I'm not sure if
setOrdinal()
is a good name for it.