Skip to content
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

Add message factories #50

Closed
wants to merge 1 commit into from
Closed

Add message factories #50

wants to merge 1 commit into from

Conversation

sagikazarmark
Copy link
Member

Factory implementations for PSR-7 related objects.

It adds one external dependency (which becomes stable this week). It provides Factory interfaces.

The idea behind this project is that message construction COULD also be standardized. It's not a requirement, but can be useful in some cases. Actually it is useful in any cases where you allow using any kind of PSR-7 implementation, not just one.

We regularly use it in HTTPlug and any packages which rely on it: FOS HTTP Cache, FXMLRPC, possibly in the future Geocoder too.

We had these interfaces implemented in a custom repository along with factories for Diactoros, but we realized that it would be cool if factories were provided by implementations themselves. In case of Diactoros it is possibly harder, because it already provides some factories which are incompatible with these interfaces. In such cases we have to use bridge packages, like this:

https://github.com/mekras/httplug-diactoros-bridge

However it adds an extra dependency, and somewhat redundancy, as you require a message implementation AND a bridge package for it.

Not sure if it is something that you want to merge, but I thought I would submit it anyway.

/cc @dbu @joelwurtz @mekras

@jeskew
Copy link

jeskew commented Dec 14, 2015

I'm -1 on taking on a new external dependency, especially if it's just to provide built-in integration with a different third-party library. I think keeping the proposed change in a repository that depends on this package is a better solution.

@dbu
Copy link

dbu commented Dec 14, 2015

the aim of php-http is not to be any third-party library but the common standard for creating messages and abstracting from specific clients. it should eventually be turned into a PSR.

but i can see that we are too early to be sure whether this will work out.

@mtdowling
Copy link
Member

Agreed with @jeskew. In it's current state, I see this as an integration that should be made in the third-party library and not in Guzzle. If this ever becomes a PSR, we can look at integrating support in this repo.

@mtdowling mtdowling closed this Dec 14, 2015
@sagikazarmark
Copy link
Member Author

sagikazarmark commented Dec 14, 2015 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants