Open voegii opened 11 months ago
I'm sorry for the delay in responding. Thank you for poiting out this issue.
Concerning the deprecation notices from PHP 8.1, you're right. PHP has updated the JsonSerializable interface's jsonSerialize method to expect a mixed return type. Your implementation of the #[\ReturnTypeWillChange]
attribute is a suitable workaround for the time being, as you’ve rightly pointed out.
In terms of our ongoing support for PHP 7, which doesn't recognize the mixed return type, we're unable to incorporate it at the moment. So, using the #[\ReturnTypeWillChange]
attribute is our best maneuver until we no longer need to support PHP 7.
We're fully aware that these are deprecation warnings, not errors, and while they need to be addressed eventually, they're not a high priority at the moment. Our focus is on maintaining the quality and stability of the existing codebase, which we’re actively doing. Also, being an open-source project, we greatly value contributions from our user community. We’d be more than happy to look at any pull requests.
After installing the plugin following warnings appears on Moodle administration page:
We have solved it temporarily with the
#[\ReturnTypeWillChange]
hint.Moodle 4.2 with PHP 8.1 (Test server with enabled error reporting and debug display)