moneyphp / money

PHP implementation of Fowler's Money pattern.
http://moneyphp.org
MIT License
4.6k stars 440 forks source link

jsonSerialize() method made compatible with PHP 8.1 #669

Closed daniser closed 2 years ago

daniser commented 2 years ago

This library fails to work in PHP 8.1 environment because signatures of internal methods has changed (see https://wiki.php.net/rfc/internal_method_return_types).

This PR adds #[ReturnTypeWillChange] attribute to jsonSerialize() methods to suppress deprecation warning on PHP 8.1.

frederikbosch commented 2 years ago

This will not be merged before the arrival of PHP 8.1, and not before PHP 8.1 has been added to the CI environment (Github Actions).

driesvints commented 2 years ago

Just FYI, not that I want to force mine or anything, but it's better to look into https://github.com/moneyphp/money/pull/670 to add the return types themselves since the classes are final any way. I'm also following up with third party dependencies that still need PHP 8.1 support.

frederikbosch commented 2 years ago

I'll close this in favor of the PR by @driesvints that addresses more 8.1 issues, and has another fix for the serialization problem.