When I run a TestCase using the Visibility Enum I get this error;
Error: Duplicate value in enum NotificationChannels\Fcm\Resources\Visibility for cases VISIBILITY_UNSPECIFIED and VISIBILITY_PRIVATE
Pliease update this line of code: case VISIBILITY_UNSPECIFIED = 'PRIVATE';here
to a different value since the current setup is not allowed according to the specs:
If an enumeration is marked as having a scalar equivalent, then all cases must have a unique scalar equivalent defined explicitly. There are no auto-generated scalar equivalents (e.g., sequential integers). Backed cases must be unique; two backed enum cases may not have the same scalar equivalent. However, a constant may refer to a case, effectively creating an alias. See Enumeration constants.
You could change the value to contain a different value, you could remove the case altogether or you could setup a constant as described in the page for enum constants: https://www.php.net/manual/en/language.enumerations.constants.php.
I think the latter would be the easiest because it causes all calls to Visibility::VISIBILITY_UNSPECIFIED to keep working, and in cases where someone save these value to a database it will stay equivalent to the saved value as well.
When I run a TestCase using the Visibility Enum I get this error;
Error: Duplicate value in enum NotificationChannels\Fcm\Resources\Visibility for cases VISIBILITY_UNSPECIFIED and VISIBILITY_PRIVATE
Pliease update this line of code:
case VISIBILITY_UNSPECIFIED = 'PRIVATE';
here to a different value since the current setup is not allowed according to the specs:from: https://www.php.net/manual/en/language.enumerations.backed.php
You could change the value to contain a different value, you could remove the case altogether or you could setup a constant as described in the page for enum constants: https://www.php.net/manual/en/language.enumerations.constants.php. I think the latter would be the easiest because it causes all calls to
Visibility::VISIBILITY_UNSPECIFIED
to keep working, and in cases where someone save these value to a database it will stay equivalent to the saved value as well.