muxinc / mux-php

Official Mux API wrapper for PHP projects, supporting both Mux Data and Mux Video.
MIT License
40 stars 30 forks source link

`mixed` return type not compatible with php 7.4 #60

Closed regularmike closed 2 years ago

regularmike commented 2 years ago

On the readme for this repo it still says PHP 7.1 or higher under Requirements, but I see that in the description for 3.4.0 it includes "PHP only: changed supported PHP versions to 7.4 and 8.1." However, as far as I can tell the mixed return type is not yet available in PHP 7.4 but was added in 3.4.0, e.g. https://github.com/muxinc/mux-php/blob/master/MuxPhp/Models/AssetResponse.php#L257

We're now seeing this error in production: TypeError: Return value of MuxPhp\Models\AssetResponse::offsetGet() must be an instance of MuxPhp\Models\mixed, instance of MuxPhp\Models\Asset returned

Are we missing something?

hsmess commented 2 years ago

Also having this issue on php7.4, annoyingly

regularmike commented 2 years ago

@hsmess we had to downgrade to 3.3.1. Still no response here or on a PR that someone opened to address: https://github.com/muxinc/mux-php/pull/58

jaredsmith commented 2 years ago

This should now be fixed in 3.8.0. Please give it a try, and open a new issue if you still have problems with PHP 7.4.x and that new release.