common
common copied to clipboard
fix: do not cast BackedEnum identifiers to int
Another way to solve https://github.com/doctrine/common/pull/997 Thank's to @malarzm for the test (https://github.com/doctrine/common/pull/998)
The applied solution: only cast to int
if return value is not a instance of BackedEnum
.
Another solution would be to check the return value is numeric (is_numeric) but if it is null it will change the behavior (null
instead of 0
)