Skip to content

Commit 4605491

Browse files
committed
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
1 parent e8091f6 commit 4605491

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Pushok
22

3-
[![PHP >= 7.2](https://img.shields.io/badge/php-%3E%3D%208.0-8892BF.svg?style=flat-square)](https://php.net/)
3+
[![PHP >= 8.0](https://img.shields.io/badge/php-%3E%3D%208.0-8892BF.svg?style=flat-square)](https://php.net/)
44
[![Build Status][ico-travis]][link-travis]
55
[![Latest Version on Packagist][ico-version]][link-packagist]
66
[![Total Downloads][ico-downloads]][link-downloads]

src/Payload.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ public function toJson(): string
458458
* @return array
459459
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
460460
*/
461+
#[\ReturnTypeWillChange]
461462
public function jsonSerialize()
462463
{
463464
$payload = self::getDefaultPayloadStructure();

src/Payload/Alert.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ public function toJson(): string
325325
* @return array
326326
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
327327
*/
328+
#[\ReturnTypeWillChange]
328329
public function jsonSerialize()
329330
{
330331
$alert = [];

src/Payload/Sound.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public function toJson(): string
139139
* @return array
140140
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
141141
*/
142+
#[\ReturnTypeWillChange]
142143
public function jsonSerialize()
143144
{
144145
$sound = [];

0 commit comments

Comments
 (0)