Problem/Motivation
In PHP 8.1 a tentative return type was added to the method: JsonSerializable::jsonSerialize()
These trigger a deprecation warning on existing code. Code that is compatible with PHP 8.1 only can add the return type now, for backward compatibility we can declare #[ReturnTypeWillChange] which silences the warning and tells PHP we will add the return type later on.
Proposed resolution
Add #[ReturnTypeWillChange] to jsonSerialize method.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3278937.patch | 475 bytes | nsavitsky |
Comments
Comment #2
nsavitsky commentedComment #3
dewalt commentedComment #5
dewalt commented