Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace GuzzleHttp with PSR-18 HTTP Clients #1032

Merged
merged 3 commits into from
Dec 11, 2024

Conversation

flavioheleno
Copy link
Contributor

This pull request replaces the Guzzle HTTP Client with PSR 17 and 18 interfaces. Closes #1019.

Changes to Dependencies:

  • The dependencies psr/http-client, psr/http-factory, and psr/http-message were added to the require section.
  • The guzzlehttp/guzzle package was moved to the require-dev section.

Changes to the AbstractProvider Class:

  • Guzzle's HttpClientInterface was replaced with ClientInterface from the PSR-18 standard.
  • Guzzle's RequestFactory was replaced with RequestFactoryInterface and StreamFactoryInterface from the PSR-17 standard.

Removal of the RequestFactory Class:

  • The entire RequestFactory class was removed as it's no longer needed with the introduction of the PSR-17 standard interfaces.

@flavioheleno flavioheleno force-pushed the feat/psr-http-client branch from 5339d7d to d043769 Compare July 12, 2024 20:43
@verfriemelt-dot-org
Copy link

what needs to happen to move forward with this? :)

@verfriemelt-dot-org
Copy link

i tested this with my application and can confirm that everything is working as expected so far for me 👍

@ramsey
Copy link
Contributor

ramsey commented Dec 10, 2024

I'll review this while I'm on holiday, coming up in a couple of weeks, and will merge it then. It might require a new major version, which I'm happy to tag for this.

We have an interesting history with these kinds of requests, and I bet @shadowhand would agree with me that we are way overdue to accept this. 😁

I'm going to tag a bunch of issues and PRs from over the years here, just to connect things together:

@ramsey
Copy link
Contributor

ramsey commented Dec 10, 2024

Don't worry about the test failures on PHP 7.1 and earlier. If I tag this for a new major version, I'll be dropping support for everything before PHP 8.1.

@flavioheleno
Copy link
Contributor Author

I'll fix the unit tests errors running on 8.1+

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (3.x@c8cc03e). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff           @@
##             3.x    #1032   +/-   ##
======================================
  Coverage       ?   99.03%           
  Complexity     ?      195           
======================================
  Files          ?       19           
  Lines          ?      517           
  Branches       ?        0           
======================================
  Hits           ?      512           
  Misses         ?        5           
  Partials       ?        0           
Files with missing lines Coverage Δ
src/Provider/AbstractProvider.php 98.03% <100.00%> (ø)

@ramsey ramsey changed the base branch from master to 3.x December 11, 2024 23:17
@ramsey
Copy link
Contributor

ramsey commented Dec 11, 2024

@flavioheleno FYI, I've created a 3.x branch that targets PHP 8.1+, and I've repointed the based of this branch to 3.x and resolved the conflicts in composer.json.

@ramsey ramsey merged commit 94dd102 into thephpleague:3.x Dec 11, 2024
12 checks passed
@flavioheleno flavioheleno deleted the feat/psr-http-client branch December 12, 2024 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow any psr-18 http client (instead of requiring guzzle)
3 participants