Skip to content

PHP 8.2 compatibility - jsonSerialize deprecation warning #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mgoniwiecha opened this issue Dec 1, 2023 · 0 comments
Open

PHP 8.2 compatibility - jsonSerialize deprecation warning #3

mgoniwiecha opened this issue Dec 1, 2023 · 0 comments

Comments

@mgoniwiecha
Copy link

I got a deprecation notice with php 8.2.

PHP Deprecated: Return type of Scayle\StorefrontApi\Models\ApiObject::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice ...

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.

Here it was fixed within the Admin-API: scayle/admin-api-php-sdk@v1.13.0...v1.13.1 (see scayle/admin-api-php-sdk#1)

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

No branches or pull requests

1 participant