-
Notifications
You must be signed in to change notification settings - Fork 187
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
Improving the usage section #73
base: master
Are you sure you want to change the base?
Conversation
ibrahimab
commented
Feb 3, 2016
- added examples on how to use the PSR-7 standard:
- using it to create your own implementation
- consuming it with an real world api service example
|
||
<a name="writing-implementation"></a> | ||
## Writing your own implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👎 there are already enough implementations
I don't think this belongs here. Just put a link to https://packagist.org/providers/psr/http-message-implementation and done. |
I agree with @Tobion that we likely do not and should not detail how to implement, other than to say "implementations should implement all functionality in each interface" and leave it at that. I also agree with @Tobion that the "consuming PSR-7" section should link to providers. Are you willing to make those changes, @ibrahimab ? |
I am, I will post my new changes tomorrow night. |
3b9757c
to
96868a2
Compare
* added examples on how to use the PSR-7 standard: - using it to create your own implementation - consuming it with an real world api service example
96868a2
to
72bc107
Compare
@weierophinney I have made the changes and pushed it into this pull request. Can you review if this is acceptable to you? |
I don't think Guzzle implementation is valuable. For example, I don't need it at all. IMHO This section should be
|
Guzzle is not good implementation for PSR-7. |
It is not about how Guzzle uses the PSR in its Client class, it is about how Guzzle depends on the specification to define its request/response/etc. classes. The Client class is not on trial here. The fact that I can replace each and every class in Guzzle that implements PSR-7 is a good enough reason to include it. edit |
Good enough to accompany Guzzle's repo with descriptions of how it's depends on or implemets PSR-7 |
@vladkras what do you mean? |
I just think, having a usage section that just says "We'll certainly need some stuff in here." will scare off beginners and my commit helps them on their way. |
@ibrahimab I mean when you say "Guzzle needs ..." or "Guzzle supports ..." or "Guzzle depends on ..." you MUST write it in Guzzle. It has nothing to do with explaining how to implement http-messages edit |
@vladkras If you read my explanation in the "consuming" chapter, you can read that I only use guzzle as an example. The example code I provide can work on any PSR-7 compatible library. But what about the example code is non-agnostic to you? The ClientInterface is not a part of PSR-7 but an example as to how to make the Guzzle implementation agnostic for your services like PostsService did in the example code (see OtherHttpClient class). |
@ibrahimab There's nothing wrong with your example except the place where you are trying to post it. Feel free to fork this repo and implement it. No need to paste your code in README. But as far as Guzzle already has it's own PSR-7 https://github.com/guzzle/psr7 You can just provide a link to https://github.com/guzzle/guzzle/blob/master/src/ClientInterface.php in Links section not Usage one |
@vladkras Do you not agree that beginners who want to get started working with PSR-7 who do not know how to use PSR-7 can be helped with the example code in the usage section? I could change the section to use a fictitious library to make it less coupled? |
@vladkras the link you provided shows beginners how to use Guzzle but does not explain what Psr-7 has to do with it. It does not show how to write your own application code to decouple it from Guzzle where my example does do that. |
@ibrahimab Exactly, I think Usage section MUST NOT contain Guzzle, it MUST be pure PHP, but you MAY mention it in Links section (and even mark as *easiest), along with Zend, Symfony and other implementations |
@vladkras Okay, I will rewrite the usage section to use a fictitious library instead of Guzzle and link to several implementations. |
@ibrahimab, So do you just want to write the instruction that Guzzle best matches to? I'm integrating it right now in my project and my steps should be:
This what "usage" means. Kind of quick start guide, not "use my favorite library cause it's a best approach". I don't argue Guzzle is good, but you should fork this repo, compose with Guzzle and push your own implemetation to your repo, write best README ever there and provide link. If you're sure this is not already done here https://github.com/guzzle/psr7 |