@Alexander Makarow asked: "What would be the benefit having it? "
So, the problem this would solve is; imagine a use case, for example with a
static http factory that tries to auto-detect an http factory
implementation (such as Nyholms' or Guzzles'). Having an
HttpFactoryInterface would serve the following benefit in such a use-case:
1. If the developer wanted to add his own factory, the HttpFactoryInterface
would allow type hinting;
2. We could ensure an HttpMessageFactory implementation always has all the
required factory methods to create http message related classes;
3. Implementations (such as Nyholms' or Guzzles') could easily be swappable;
4. It promotes ease of use for creating http messages.
PS: @alexander Sorry, I ended up creating a duplicate post, the one you
replied to I deleted, so I'm posting the reply here.
On Monday, November 11, 2019 at 11:32:23 PM UTC+1, Daniyal Hamid wrote:
>
> Hi,
>
> I was wondering if it would be a good idea to create an
> HttpFactoryInterface class that basically is an amalgamation of all PSR-17
> interfaces, something like:
>
> interface HttpFactoryInterface extends
> RequestFactoryInterface,
> ResponseFactoryInterface,
> ServerRequestFactoryInterface,
> StreamFactoryInterface,
> UploadedFileFactoryInterface,
> UriFactoryInterface
> {
> }
>
>
>
> Guzzle <https://github.com/guzzle/psr7/blob/master/src/HttpFactory.php>
> and Nyholm
> <https://github.com/Nyholm/psr7/blob/master/src/Factory/Psr17Factory.php>
> already
> have HttpFactories as such so maybe it's a good idea to add such an
> interface?
>
--
You received this message because you are subscribed to the Google Groups "PHP
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/php-fig/f4f25988-528d-4b81-be83-d74d8898b3e6%40googlegroups.com.