php-enum icon indicating copy to clipboard operation
php-enum copied to clipboard

Allow to specify getValue return type

Open wslawski-printify opened this issue 2 years ago • 1 comments
trafficstars

Not sure why exactly getValue method is final. I want to be able to specify exactly which type is returned there without using php doc. So would like to override getValue method and specify string there. Any reasons why you don't allow to use covariance in this specific case?

wslawski-printify avatar Mar 28 '23 11:03 wslawski-printify

I would be interested in your use case here first. Especially why PHP doc is not an option.

In general overwriting getValue doesn't make much sense and it would loose guaranty that it's actually returning the enum value and not something else.

marc-mabe avatar Mar 29 '23 18:03 marc-mabe

closed due to inactivity

marc-mabe avatar Apr 03 '24 07:04 marc-mabe