it is not compatible with guzzle >=6
yuseferi opened this issue · 5 comments
Hi,
I'm using guzzle 6.4 on my project but after using your package I face with
PHP Fatal error: Interface 'GuzzleHttp\Event\SubscriberInterface' not found in /srv/www/application/vendor/kamermans/guzzle-oauth2-subscriber/src/OAuth2Subscriber.php on line 15
after some investigation on the guzzle package github, I noticed this interface has been renamed.
Could you provide more info, like you add the OAuth middleware to your Guzzle client? A reproducible example would be great.
I can confirm this for Guzzle 7.
For example here the code is accessing to GuzzleHttp\ClientInterface::VERSION
which is not present on Guzzle 7 anymore.
I have a Dependabot PR upgrading Guzzle from 6 to 7 that raises a bunch of errors like that one on TravisCI.
I will try to take a look at this if I have some spare time this month and fix the compatibility issues.
Also I think the version string on composer.json
should be updated until then, because guzzlehttp/guzzle": ">=4.0
if I'm not wrong means that the latest Guzzle version will be pulled even those that are no compatible anymore.
I am facing the same issue, I have created a PR for this.
Hi all, sorry for the delayed response, I'll merge the PR from @lasselehtinen to resolve this.
@yuseferi your error is caused by using the OAuth2Subscriber
with Guzzle 6, but it only works for Guzzle 5 and below. For Guzzle 6+ you should use the OAuth2Middleware
as described here: https://github.com/kamermans/guzzle-oauth2-subscriber#middleware-guzzle-6