Nyholm / psr7

A super lightweight PSR-7 implementation
MIT License
1.15k stars 75 forks source link

chore(deps): allow psr/http-message v2 #223

Closed simPod closed 1 year ago

nicolas-grekas commented 1 year ago

In the CI:

  • Locking psr/http-message (1.1)

So that's not enough.

Also, is this lib really compatible with v2? Doesn't it miss some return types?

simPod commented 1 year ago

Hm, let's test it.

simPod commented 1 year ago

There are indeed some type changes required but I believe the v2 support won't be possible now since old php versions are allowed.

nicolas-grekas commented 1 year ago

We should bump to PHP >=7.2 also

simPod commented 1 year ago

If that's okay with you I've opened >=7.2 PR here https://github.com/Nyholm/psr7/pull/226

simPod commented 1 year ago

Also, I think we cannot have support for both v1 and v2 since methods with typed arguments are not backward compatible.

nicolas-grekas commented 1 year ago

methods with typed arguments are not backward compatible

because of the behavior change when passing incompatible types, or?

simPod commented 1 year ago

Because changing e.g.

-     public function withProtocolVersion($version): self
+     public function withProtocolVersion(string $version): self

is required and compatible with v2 but not compatible with v1

nicolas-grekas commented 1 year ago

It's compatible with 1.1, so we could just bump to ^1.1|^2.0, no?

simPod commented 1 year ago

Test suite is being adapted here https://github.com/php-http/psr7-integration-tests/pull/68

nicolas-grekas commented 1 year ago

Closing in favor of #234, thanks for pushing for this.