twilio / twilio-php

A PHP library for communicating with the Twilio REST API and generating TwiML.
MIT License
1.57k stars 562 forks source link

Add dependency on guzzlehttp/psr7 #692

Closed tomcastleman closed 1 month ago

tomcastleman commented 3 years ago

Fixes

Since #689 the minimum version of guzzlehttp/psr7 should be^1.7.0 due to the use of GuzzleHttp\Psr7\Query.

However the dependency of guzzlehttp/psr7 is currently only inferred through the dependency for guzzlehttp/guzzle:^6.3 || ^7.0.

Should guzzlehttp/guzzle resolve to version 6.5 (as at the time of writing), the inferred minimum version of guzzlehttp/psr7 is only ^1.6.1. In my case I had another dependency declaring guzzle/psr7:<1.7 and so the issue did not become apparent during composer update, but only via a runtime exception in the app when the Query class was not found.

Technical details:

Checklist

If you have questions, please file a support ticket, or create a GitHub Issue in this repository.

GrahamCampbell commented 2 years ago

Guzzle maintainer here. It is not necessary to ask for 1.7.0. ^1.6 || ^2.0 is best, so long as you use the modern static class method API, rather than the legacy functions API. It was added in 1.6.0.

GrahamCampbell commented 2 years ago

If you wanna sure the versions installed are definitely PHP 8.1 compatible, you can use ^1.8.3 || ^2.1.

phpfui commented 2 years ago

@tomcastleman Take the suggestion from @GrahamCampbell and update the psr7 dependency. This will help with 8.1 compatibility. You will also have to remove the theseer/phpdox dependency, as it was removed after your branch was made.

I just got the other 8.1 fixes merged, so if you get this merged, then 8.1 will be fully supported. Then @shwetha-manvinkurke can merge and release an SDK fully supporting 8.1, which will be awesome for us cutting edge people.

GrahamCampbell commented 1 year ago

https://github.com/twilio/twilio-php/pull/776 replaces this PR.