Closed iluuu1994 closed 3 years ago
Not a hill I'll die on either way. Mainly I'm just trying to balance "make enums as powerful as possible" without becoming "there's really no reason to not just use objects". :smile:
@iluuu1994, @Crell then I would propose to implement abstract methods to be available for Enum class as well. It might give a possibility to easy control methods implementation for each case w/o introducing new interface:
enum SomeEnum {
case FirstCase {
public function color() {}
}
case SecondCase {
public function color() {}
}
abstract public function color();
}
This is now irrelevant.
Since we allow implementing methods that are only available in a subset of the cases allowing to implement interfaces only for a subset of cases would probably also make sense.