Skip to content

PHP 8.2 compatibility - jsonSerialize deprecation warning #3

@mgoniwiecha

Description

@mgoniwiecha

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions