Closed albertoarena closed 2 years ago
The tests seem to indicate that it's working fine. Could you submit a PR with a failing tests (and maybe also the fix)?
@freekmurze That occurs in PHP 7.4.
We have a few projects using spatie/laravel-fractal
that are still on PHP 7.4.
Our deployment scripts run composer update
that used latest version 2.9.2 of spatie/fractalistic
, that was released today.
We noticed failures in unit tests.
Latest changes deployed as version 2.9.2 may not be compatible with PHP 7.4 due to mixed
pseudo type used in public function jsonSerialize(): mixed
.
I'll run a few tests in PHP 7.4 and 8.1, and create a pull request with a solution that makes spatie/fractalistic
backward compatible with PHP 7.4.
@freekmurze I have a fix ready, tested with php 7.4 and 8.1, but I am not allowed to create a pull request.
Should I be added to contributors?
Thanks
Creating pull requests is not restricted in any way.
We'll handle this further in #55
This change done to support PHP 8.1 triggers a
Type error
.Commit: https://github.com/spatie/fractalistic/commit/4d3b8a68b6575e9b0202e842977c9c29224fd9ac#diff-9ebff18d48644c7d6e2c1006245d57ef9028099e796f76f967c8656aedadcf4bR458
Change: https://github.com/spatie/fractalistic/blob/5a89b24d3153a9c4b17cd1ed523b0a5ef9143558/src/Fractal.php#L458
Error:
Reason:
Fractal::toArray
return type isarray
Fractal::jsonSerialize()
return type osmixed
Further details: