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

refactor: allow dependency injection of httpClient #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andheiberg
Copy link

Previously the GuzzleHttp Client was created inside the Request helper which it self was instanciated in the Client. This made it impossible to dependency inject a http Client of my own choosing.

While making DI possible I opted for removing the Request class entirely as it wasn’t creating much value.

Previously the GuzzleHttp Client was created inside the Request helper which it self was instanciated in the Client. This made it impossible to dependency inject a http Client of my own choosing.

While making DI possible I opted for removing the Request class entirely as it wasn’t creating much value.
* @throws HeapException
* @throws GuzzleException
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Within this scope I see HeapException being thrown.

Why GuzzleException has been added to the doc block?

@@ -2,22 +2,43 @@

namespace Heap;

use GuzzleHttp\ClientInterface;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about adding support for PSR-18 and using its ClientInterface?

https://www.php-fig.org/psr/psr-18/

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.

2 participants