mux-php
mux-php copied to clipboard
Return Type Exceptions with PHP 8.1
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.
Thanks for reporting this. We'll take a look and see if we can make this work better.
Can you please test to see if the new 3.8.0 release works better in this regard, please?