-
Notifications
You must be signed in to change notification settings - Fork 28
Support PSR-18 #43
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
Support PSR-18 #43
Conversation
src/Client.php
Outdated
@@ -24,7 +25,7 @@ | |||
* | |||
* @since 1.0 | |||
*/ | |||
class Client implements HttpClient, HttpAsyncClient | |||
class Client implements HttpClient, HttpAsyncClient, ClientInterface |
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.
Would it make sense to let Http\Client\HttpClient
extend Psr\Http\Client\ClientInterface
? Then, HTTPlug consumers would not have to update their type hints if they are currently using HttpClient
instead of a concrete implementation (hopefully they do).
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.
It already does. :)
I just added it here to be more explicit.
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.
Oh.. I got this error.
Class Http\Client\Curl\Client cannot implement previously implemented interface Psr\Http\Client\ClientInterface in /home/travis/build/php-http/curl-client/src/Client.php on line 28
"ext-curl": "*", | ||
"php-http/httplug": "^1.0", | ||
"php-http/httplug": "^2.0", |
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.
HTTTPlug extends psr/http-client.
If this require a new major version why not requiring the psr only? EDIT : In fact may be better in a 3.0 so we let time for people to upgrade to the psr |
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.
do i see correctly that we use httplug 2.0 to support psr-18 but provide a convenient migration path for code that is based on httplug? should we nonetheless require psr-18 explicitly instead of relying on indirectly getting it through httplug?
yes, see https://3v4l.org/Drbl2 |
We should probably create a |
i created the 1.7 branch from current master, and added the branch alias to this PR. |
composer.json
Outdated
} | ||
} | ||
} |
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.
Looks likes this line has to be removed.
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.
🤦♂️ removed it
\o/ |
This will require a new major version. We do not have to release 2.0 right after merging this PR but we should release 2.0 this year.
This is just a "technical" BC break. We could consider other changes as well.