plank / laravel-mediable

Laravel-Mediable is a package for easily uploading and attaching media files to models with Laravel
MIT License
758 stars 100 forks source link

update psr/http-message requirement to allow v1 or v2 #329

Closed jason-nabooki closed 6 months ago

jason-nabooki commented 1 year ago

https://github.com/plank/laravel-mediable/pull/318 bumped the requirement to a hard v2 which is causing issues with other packages that require v1.

Could it be considered to allow the proposed ^1.0|^2.0 was there any hard requirement for v2 or just a housekeeping change?

jason-nabooki commented 1 year ago

cc @frasmage

frasmage commented 1 year ago

actually, there are hard requirements for only using one version. The \Plank\Mediable\Stream class in the library implements the \Psr\Http\Message\StreamInterface from that package. The methods signatures changed between v1 and v2 and the implementing class can only adhere to one of them

jason-nabooki commented 1 year ago

Ah, the types added to the Stream.php methods in https://github.com/plank/laravel-mediable/pull/318 require v2? I couldn't see much else in https://github.com/plank/laravel-mediable/compare/5.9.0...5.9.1

So I guess the options are to revert or leave it as is. If you'd be open to reverting, I could submit a PR.

The issue we're facing is the official Laravel vapor-core package strictly requires v1 (recently introduced).

frasmage commented 6 months ago

in the v6 branch, I've replaced this package's Stream class with the guzzlehttp/psr7 implementation, which appears to support both versions of the psr\http-message specification