edamov / pushok

PHP client for Apple Push Notification Service (APNs) - Send push notifications to iOS using the new APNs HTTP/2 protocol with token-based (JWT with p8 private key)
MIT License
368 stars 119 forks source link

php^8.0 requires return type for jsonSerialize to be of type mixed #154

Closed sica07 closed 1 year ago

sica07 commented 1 year ago

I upgraded to php8.1 and now I get a complain about incompatible return type for the Alert::jsonSerialize function:

Fatal Error - During inheritance of JsonSerializable: Uncaught Fuel\Core\PhpErrorException: Return type of Pushok\Payload\Alert::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/vendor/edamov/pushok/src/Payload/Alert.php:328

For compatibility reasons I added the mixed return type to the function declaration.

sica07 commented 1 year ago

I've just noticed that there already exists a MR with this fix. Thus, I'm closing this one.