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.1 compatablity #146

Closed srjlewis closed 1 year ago

srjlewis commented 2 years ago

Add return type to jsonSerialize call in payload to satisfy PHP 8.1 interfaces enforcement

dutchie027 commented 2 years ago

You actually need a lot more changes that what is above to support PHP 8.1 :) I forked the master branch and made a bunch of changes and now it supports 8.1, rather than submitting a huge PR. I also architecturally changed it by removing a lot of reliance for the JWT libs and make the JWT on the fly.

fbett commented 1 year ago

This fix has worked for me. Thank you! I had to upgrade also the dependency "fgrosse/phpasn1", required from "web-token/jwt-core" from original "^2.0" to "^2.4".

mobielbekeken-thijs commented 1 year ago

Please note that the 'mixed' keyword added in this PR is not compatible with PHP <8.0

knyjoh commented 1 year ago

I've added another PR: https://github.com/edamov/pushok/pull/156 which uses 'array' instead of the 'mixed' keyword.

It's already documented to be an array and thus should be more correct, and also has the benefit of being backwards compatible.

edamov commented 1 year ago

@knyjoh Thanks! It was merged

stollr commented 1 year ago

@edamov I think this PR can be closed now.