Skip to content

Conversation

flack
Copy link
Contributor

@flack flack commented Feb 23, 2023

Currently, on PHP8.1 and later, you get the following deprecation notice:

( ! ) Deprecated: Return type of StellarWP\Validation\ValidationRuleSet::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in src/ValidationRuleSet.php on line 264

We can't add mixed return type to the function, because that would not work in PHP7, so we just add a suppression as recommended by the error message

@JasonTheAdams
Copy link
Member

This is great, @flack! Thank you for submitting this as well as providing a clear explanation!

@JasonTheAdams JasonTheAdams changed the title Suppress PHP8.1+ notice Fix: Suppress PHP8.1+ notice for jsonSerialize Feb 23, 2023
@JasonTheAdams JasonTheAdams merged commit 242798d into stellarwp:develop Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants