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

PHP compatibility #58

Closed tim-hanssen closed 2 years ago

tim-hanssen commented 2 years ago

Since release 3.4.0 the package is no longer support by PHP versions below 8.1. The release notes say that support below 7.4 is dropped. But the change for example in https://github.com/muxinc/mux-php/blob/40178372ad8d3b3f60ec60fddb02e193ea711168/MuxPhp/Models/PlaybackID.php#L287 adding type declaration "mixed" (https://www.php.net/manual/en/language.types.declarations.php) is only supported since PHP 8, and breaks implementations below that.

It broke our implementation while updated by our dependency bot.

TypeError: Return value of MuxPhp\Models\PlaybackID::offsetGet() must be an instance of MuxPhp\Models\mixed, string returned in file /vendor/muxinc/mux-php/MuxPhp/Models/PlaybackID.php on line 289

Not sure if support for 7.4 should be dropped, since this requires all users to update to PHP 8.1.

tim-hanssen commented 2 years ago

As far as I can see, this is still broken.

regularmike commented 2 years ago

Very odd that this still doesn't seem to be on anyone's radar. I even created an issue myself a while back because I hadn't noticed your PR: https://github.com/muxinc/mux-php/issues/60

jaredsmith commented 2 years ago

PR #67 contains a fix for this issue as well -- I'd appreciate another set of eyes on it before I merge it.

jaredsmith commented 2 years ago

I just released version 3.8.0 of the package, which should fix this issue. If not, please feel free to comment on this issue or open another issue.