-
Notifications
You must be signed in to change notification settings - Fork 182
Introduce new PSR-18 based client #257
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
Conversation
Move Api instantiation into trait
Move json- and XML-decoding into AbtractApi Fix and improve all tests
Simplify error messages in JSON decoding
I've checked the possibilities for using this library without composer. Because new dependency to Fortunately, there are now online tools that can be used instead of doing this manually: I think, this should allow us to remove the |
cool @Art4 , I didn't know about this service! 👍 |
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.
too long to review till the end! 😅
amazing work!!! 💪
I would try to type hint everything (new at least) and get rid of most of the useless docblocks
But this can be done in another PR, up to you!
Typed properties where released with PHP 7.4. I wanted to keep the PHP 7.3 compatibility. I would leave typed properties to a future release to allow a smoother migration. |
Thank you for your first review @kbsali. I will admit your suggestions as best as possible. While working on this PR I developed this possible roadmap: Release 1.7
Release 1.8
Release 2.0
What do you think? |
rename $data to $body rename $decode to $decodeIfJson
I like your plan! :) |
Also, why adding a new "usage.md" file? How about updating the README instead? And final point : would you be interested in maintaining the package yourself? |
Thank you. 👍
I introduced the method I now also added tests to guaranty the old behavior on the old client, see d419e1e
I thought about moving the example.php and examples from README into a new docs folder. There will be also the migration guide. This would blow up the README.md But if you wish I could leave that in the README.md. Or we move this docs discussion into a separate PR.
It is a honor for me that you consider me as a maintainer, but I'm afraid I have to decline. I'm already maintaining some projects myself. But I'd be happy to contribute code and bugfixes and reply to issues if I find some time (like in the last days). |
I moved the usage docs into README.md. I will create the migration guide into another PR. From my side this PR is ready for merge. |
awesome work! thanks a lot! |
Hey,
I would like to introduce a HTTP client agnostic client based on PSR-18 and PSR-17.
I'm not done yet, but would like to hear what you have to say about it.
It is important to me that all changes in this PR are backward compatible. If you find a BC break I would love to fix ist. But maybe this new client could also be a step to a v2 of this project.
Benefits of this PR
Switching to
Psr18Client
As I said before all changes in this PR are backward compatible. However switching to the new Psr18Client will create some work on the client side.
ServerRequestFactory
and ...StreamFactory
. This can be done with an anonymous class usingguzzlehttp/psr7
As you can see in the todo list im planning to create an "migrate guide" to explain the alternatives for features that will not exists in the
Psr18Client
(like port handling, ssl checks and host customization).I also have to determine what this PR will mean for an installation without
composer
.Todo
example.php
Cheers 🥂
Update: Creating the migrate guide will be made in another PR.