Closed bishabosha closed 1 year ago
previously, as soon as a singleton enum case requires to pass parameters to its parent, an anonymous class is generated for the case - which seems unnecessary when there is no variance except for passed parameters
for the cases of singleton enum values where the enum definition has parameters, it would make sense to add those parameters to the
$new
creator method. This would make thePlanets
example require only three classes, (Planet
,Planet$
, and one anon class for the implementation) and not one class for each planet.This can not be extended to cases that mixin other traits, these will still need individual anonymous classes.