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

Deprecation notices with PHP 8.1 #147

Closed yodelx closed 1 year ago

yodelx commented 2 years ago

refs: https://github.com/edamov/pushok/pull/146

# php -v
PHP 8.1.3 (cli) (built: Feb 16 2022 01:00:24) (NTS gcc x86_64)

notice: Deprecated (8192): Return type of Pushok\Payload::jsonSerialize()  
should either be compatible with JsonSerializable::jsonSerialize(): mixed, 
or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice 
in [/edamov/pushok/src/Payload.php, line 429]
grep jsonSerialize -R .
/edamov/pushok/src/Payload.php:    public function jsonSerialize()
/edamov/pushok/src/Payload/Alert.php:    public function jsonSerialize()
/edamov/pushok/src/Payload/Sound.php:    public function jsonSerialize()
oktaykalfa commented 2 years ago

hello,

im having the same problem but it is still working.

If you could be able to remove the warning message, it would be nice, thanks.

Deprecated: Return type of Pushok\Payload::jsonSerialize() should either be comp chrome_euoMBZdDFF atible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

dutchie027 commented 2 years ago

If you want the notifications gone, you can clone my fork: https://github.com/dutchie027/apnpush

stollr commented 1 year ago

This is fixed by https://github.com/edamov/pushok/pull/156. Just update to a version >= 0.14.3 ;-)

stollr commented 1 year ago

@edamov I think you can close this issue