http icon indicating copy to clipboard operation
http copied to clipboard

Allow use of PSR-7 v2

Open Crell opened this issue 7 months ago • 8 comments

PSR-7 v2 just adds types, which should be safe in virtually any circumstances. It does require PHP 7.2 or higher, but allowing either version should allow Composer to figure it out.

Without this, having React installed makes a project incompatible with any package that depends on PSR-7 v2, which is a non-small number.

(I haven't tried running this locally yet; I am assuming CI will indicate if there's an issue.)

Crell avatar May 28 '25 17:05 Crell

... A segfault? I am confused.

Crell avatar May 28 '25 17:05 Crell

... A segfault? I am confused.

It's a bit of a long story: https://github.com/friends-of-reactphp/mysql/pull/205

WyriHaximus avatar May 29 '25 21:05 WyriHaximus

Just merged #543 that will resolve the segfault

WyriHaximus avatar May 29 '25 21:05 WyriHaximus

Oh, that thing...

Crell avatar May 29 '25 21:05 Crell

Hm, it's still locking psr/http-message 1.1, even on newer PHP versions that would support 2.0. I'm not sure why.

Crell avatar May 29 '25 22:05 Crell

composer why-not psr/http-message ^2

Bilge avatar May 30 '25 14:05 Bilge

ringcentral/psr7 1.3.0 requires psr/http-message (~1.0)

Well [expletive deleted]. That package appears to be abandoned. I don't know if switching to nyholm/psr7 (which is supported and solid) is viable, but this sounds like a larger problem.

Crell avatar Jun 04 '25 15:06 Crell

@Crell I've added the required changes for psr/http-message ^2.0 to PR #542, however, I solved the ringcentral/psr7 problem by removing clue/http-proxy-react from the dependencies as it is only used in 1 example. Have you tried contacting clue/http-proxy-react to see if they would be open to moving to nyholm/psr7 or similar? It would be nice if we could keep the example.

kwhat avatar Jun 10 '25 13:06 kwhat