Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Deprecated / PHP 8.2 / ReturnTypeWillChange #3

Closed
FlipZoomMedia opened this issue May 12, 2023 · 0 comments
Closed

PHP Deprecated / PHP 8.2 / ReturnTypeWillChange #3

FlipZoomMedia opened this issue May 12, 2023 · 0 comments

Comments

@FlipZoomMedia
Copy link

Thank you for the great module. Under PHP 8.2 I get a deprecation message in debug mode.

PHP Deprecated: Return type of ProcessWire\Geocoder::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in [/site/modules/FieldtypeGeocoder/Geocoder.php:119]

I'm not quite sure if this is the right solution, but if I define the retun type array for the function jsonSerialize() in line 119, I no longer get a message. But I don't know what side effects this could have.

/**
 * @return array|mixed
 */
public function jsonSerialize(): array {
    return $this->getArray();
}
julianwinkel added a commit that referenced this issue Jun 13, 2023
…return types; Update leaflet version; Add short access to coordinates;
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

No branches or pull requests

2 participants