Nyholm / psr7-server

Helper classes to use any PSR7 implementation as your main request and response
MIT License
90 stars 21 forks source link

Allow psr/http-message 2 #56

Closed derrabus closed 11 months ago

aimeos commented 1 year ago

@Nyholm When will this PR merged an a new version tagged? At the moment, all composer installations break if psr/http-message:2.0 is required

Nyholm commented 11 months ago

Hey. Of course. Sorry for the delay

mvorisek commented 11 months ago

This has broken our stable releases wit PHP 7.4 as we require this package only: https://github.com/atk4/ui/blob/5.0.0/composer.json#L56 and not "psr/http-message": "^1.0" explicitly.

Issue:

Fatal error: Declaration of class@anonymous::__toString() must be compatible
with Psr\Http\Message\StreamInterface::__toString(): string

I wonder if this is intended BC break and if this release should be untagged and released under v2.0.

Nyholm commented 11 months ago

Hey.

Thank you for the report. psr/http-message: 2 says it supports php 7.2. Where is this anonymous class used? Is it your code or a library?

mvorisek commented 11 months ago

in our codebase - but it is BC break when "psr/http-message": "^1.0" is not required explicitly in user projects/libs

Nyholm commented 11 months ago

Yeah. It seams like you have been using a dependency (psr/http-message), but not specified it in your composer.json. That is super easy to do, but it is dangerous because of situations like this.

I appreciate you reporting this and explaining how to fix it. That will probably help the next person in the same situation.