HubSpot / hubspot-api-php

HubSpot API PHP Client Libraries for V3 version of the API
Apache License 2.0
197 stars 82 forks source link

PSR-18 compatibility #292

Open faizanakram99 opened 10 months ago

faizanakram99 commented 10 months ago

This package has a hard dependency upon guzzle, it is generally considered a good practice for an SDK to not depend upon a specific implementation.

We've PSR-18 for exact this use-case. Luckily, Guzzle already implements it (https://packagist.org/providers/psr/http-client-implementation). It would allow consumers to use http client of their choice. Optionally, this package can depend upon php-http/discovery instead which provides factories and discoveries for various PSRs.

The main change would be to depend upon PSR-18 ClientInterface instead of Guzzle's ClientInterface. I see that there are some guzzle middlewares shipped for convenience about rate limiting and such, they can be left as is with a note (if you're using guzzle you can use these middlewares bla bla).

faizanakram99 commented 10 months ago

looks like OpenApiTools already supports PSR-18 https://github.com/OpenAPITools/openapi-generator/pull/16368