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

[5.7] Use ClientInterface proper request() method #25490

Merged
merged 1 commit into from
Sep 7, 2018
Merged

[5.7] Use ClientInterface proper request() method #25490

merged 1 commit into from
Sep 7, 2018

Conversation

lucasmichot
Copy link
Contributor

\GuzzleHttp\ClientInterface::post method does not exist.
We can use \GuzzleHttp\ClientInterface::request instead

@mvdnbrk
Copy link
Contributor

mvdnbrk commented Sep 6, 2018

An instance of GuzzleHttp\Client is passed to the constructor which implements the GuzzleHttp\ClientInterface interface. The client has a post method.

@X-Coder264
Copy link
Contributor

@mvdnbrk Yeah, that is true when a GuzzleHttp\Client is injected, but what if we inject some other object that implements GuzzleHttp\ClientInterface? 😄 That instance probably won't have the post method as the interface doesn't force you to implement it so everything would break. What's the point of having an interface then if it isn't gonna be honored?

@mvdnbrk
Copy link
Contributor

mvdnbrk commented Sep 6, 2018

@X-Coder264 you have a point there. I have previously committed a Pull Request with some sort of issue and it got rejected by @taylorotwell. Let Taylor decide 👏

@taylorotwell taylorotwell merged commit 0efdd6d into laravel:5.7 Sep 7, 2018
@GrahamCampbell GrahamCampbell changed the title [5.7] Use ClientInterface proper request() method. [5.7] Use ClientInterface proper request() method Sep 7, 2018
@lucasmichot lucasmichot deleted the feature/5.7/ClientInterface branch September 8, 2018 13:53
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.

4 participants