marc-mabe / php-enum

Simple and fast implementation of enumerations with native PHP
BSD 3-Clause "New" or "Revised" License
464 stars 36 forks source link

Allow to specify getValue return type #157

Closed wslawski-printify closed 7 months ago

wslawski-printify commented 1 year ago

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?

marc-mabe commented 1 year ago

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 commented 7 months ago

closed due to inactivity