Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

PHP 8.2 compatibility - jsonSerialize deprecation warning #2

Open
deegital opened this issue May 18, 2023 · 1 comment
Open

PHP 8.2 compatibility - jsonSerialize deprecation warning #2

deegital opened this issue May 18, 2023 · 1 comment

Comments

@deegital
Copy link

PHP Deprecated: Return type of AboutYou\Cloud\AdminApi\Models\ApiObject::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/vendor/aboutyou-cloud/admin-api/lib/Models/ApiObject.php on line 72

@deegital deegital changed the title PHP 8.2 jsonSerialize deprecation warning PHP 8.2 compatibility - jsonSerialize deprecation warning May 18, 2023
@mgoniwiecha
Copy link

I got also the deprecation notice with php 8.2.

In other Projects like ramsy/uuid it was fixed by adding the attribute #[\ReturnTypeWillChange] right before the method. Older php versions (<= php 7.4) ignore the attribute.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants