-
Notifications
You must be signed in to change notification settings - Fork 11
Conversation
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.
so this allows to use PSR-17 implementations in code that is still using the HTTPlug interfaces. that can help migrations, so i approve.
do we deprecate the httplug factories in version 2 but keep them for now?
and do we want to rewrite discovery to be a psr-17 discovery? that is quite a change, as it will return a different interface.
* | ||
* @author Márk Sági-Kazár <mark.sagikazar@gmail.com> | ||
*/ | ||
final class MessageFactory implements \Http\Message\MessageFactory |
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.
i usually use
such a thing and specify an alias like BaseMessageFactory, or in this case maybe LegacyMessageFactory?
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function createRequest($method, $uri, array $headers = [], $body = null, $protocolVersion = '1.1') |
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.
so this is where PSR-17 and HTTPlug differ, right?
Hi, |
when this is released, update the changes from php-http/cache-plugin#56 |
Sorry, totally forgot about it. Will try to pick this up soon. |
Hi, is the merge of this pull request planned? |
not sure how useful this is anymore, there are a bunch of factory implementations available. the most popular being guzzlehttp/psr7 and nyholm/psr7, see https://packagist.org/providers/psr/http-factory-implementation for the full list of implementations. and php-http/discovery has support for the guzzlehttp and nyholm factories. is there any need to provide a psr 17 implemenation on top of our own factories? /cc @Nyholm |
closing this in favor of #42 - we will deprecate this whole repository and point people to the PSR-17 factories. |
This PR adds a compatibility layer between our message factories and PSR-17. Once it is in place, we can refactor the discovery layer to check for PSR-17 implementations and use them instead of requiring the
php-http/message
package.After that we can deprecate the implementations of our message factories and the interfaces themselves, eventually migrating to PSR-17 interfaces. Maybe we can do it before tagging client-common 2.0?
Todo