spatie/fractalistic

PHP 8.1 deprecations

oprypkhantc opened this issue · 3 comments

Hey.

There are PHP 8.1 deprecations that this package doesn't account for. One of them is with JsonSerializable:

During inheritance of JsonSerializable: Uncaught ErrorException: Return type of Spatie\Fractalistic\Fractal::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/vendor/spatie/fractalistic/src/Fractal.php:458
Stack trace:
#0 /app/vendor/spatie/fractalistic/src/Fractal.php(13): Tests\TestCase::{closure}()

Feel free to PR the necessary fixes.

Hi, I've the same deprecation log on my server.

The latest version fixes this.