From 460549115b9e5314d5856cc96834de9b95e1811b Mon Sep 17 00:00:00 2001 From: Thomas Durand Date: Thu, 13 Apr 2023 19:25:57 +0200 Subject: [PATCH] Prevent deprecation warning when updating to PHP 8.1 while preserving PHP 8.0 compatibility. This will allow the lib user to make sure they don't have deprecation warnings on their way to 8.1 update --- README.md | 2 +- src/Payload.php | 1 + src/Payload/Alert.php | 1 + src/Payload/Sound.php | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c3f1406..522cbaf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Pushok -[![PHP >= 7.2](https://img.shields.io/badge/php-%3E%3D%208.0-8892BF.svg?style=flat-square)](https://php.net/) +[![PHP >= 8.0](https://img.shields.io/badge/php-%3E%3D%208.0-8892BF.svg?style=flat-square)](https://php.net/) [![Build Status][ico-travis]][link-travis] [![Latest Version on Packagist][ico-version]][link-packagist] [![Total Downloads][ico-downloads]][link-downloads] diff --git a/src/Payload.php b/src/Payload.php index 5932234..b75b694 100644 --- a/src/Payload.php +++ b/src/Payload.php @@ -458,6 +458,7 @@ public function toJson(): string * @return array * @link http://php.net/manual/en/jsonserializable.jsonserialize.php */ + #[\ReturnTypeWillChange] public function jsonSerialize() { $payload = self::getDefaultPayloadStructure(); diff --git a/src/Payload/Alert.php b/src/Payload/Alert.php index 46c0959..bb4f1e7 100644 --- a/src/Payload/Alert.php +++ b/src/Payload/Alert.php @@ -325,6 +325,7 @@ public function toJson(): string * @return array * @link http://php.net/manual/en/jsonserializable.jsonserialize.php */ + #[\ReturnTypeWillChange] public function jsonSerialize() { $alert = []; diff --git a/src/Payload/Sound.php b/src/Payload/Sound.php index 03053bd..2ac1ea8 100644 --- a/src/Payload/Sound.php +++ b/src/Payload/Sound.php @@ -139,6 +139,7 @@ public function toJson(): string * @return array * @link http://php.net/manual/en/jsonserializable.jsonserialize.php */ + #[\ReturnTypeWillChange] public function jsonSerialize() { $sound = [];