Open Gwemox opened 1 year ago
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)
int
BackedEnum
null
0
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 ofBackedEnum
. 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 of0
)