Skip to content

Errors on php 8.1 #3

@MorganOlufsen

Description

@MorganOlufsen

On php 8.1 when creating a new AnnotateImageRequest()

<?php $imageRequest = new AnnotateImageRequest();

A php fatal error is triggered:

Return type of GoogleCloudVision\Request\AnnotateImageRequest::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vagrant/vendor/wapnen/google-cloud-vision-php/GoogleCloudVision/Request/AnnotateImageRequest.php:68

If the #[\ReturnTypeWillChange] attribute is addeded on each jsonSerialize function, php stops complaining without me being able to detect side-effects, but i am unsure about this being the 'correct' solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions