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

Return Type Exceptions with PHP 8.1 #54

Open
mojowill opened this issue Apr 1, 2022 · 2 comments
Open

Return Type Exceptions with PHP 8.1 #54

mojowill opened this issue Apr 1, 2022 · 2 comments

Comments

@mojowill
Copy link

mojowill commented Apr 1, 2022

A lot of Models are generating return type exceptions for us in our application:

PHP 8.1.4
Mux PHP SDK 3.3.1

Return type of MuxPhp\Models\AssetResponse::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/mojowill/Sites/work/media-manager-3/vendor/muxinc/mux-php/MuxPhp/Models/AssetResponse.php on line 245

Return type of MuxPhp\Models\CreateAssetRequest::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/mojowill/Sites/work/media-manager-3/vendor/muxinc/mux-php/MuxPhp/Models/CreateAssetRequest.php on line 523

Return type of MuxPhp\Models\AssetResponse::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/mojowill/Sites/work/media-manager-3/vendor/muxinc/mux-php/MuxPhp/Models/AssetResponse.php on line 257

There are lots more I haven't pasted in. Is it possible to get a fix?

Adding #[ReturnTypeWillChange] to all models should silence any notices/errors in PHP 8.1 without affecting older versions of PHP.

@jaredsmith
Copy link
Contributor

Thanks for reporting this. We'll take a look and see if we can make this work better.

@jaredsmith
Copy link
Contributor

Can you please test to see if the new 3.8.0 release works better in this regard, please?

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