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

Guesser for UriFactory #3

Closed
ddeboer opened this issue Jun 5, 2015 · 5 comments
Closed

Guesser for UriFactory #3

ddeboer opened this issue Jun 5, 2015 · 5 comments

Comments

@ddeboer
Copy link
Contributor

ddeboer commented Jun 5, 2015

And probably UriFactory implementations for Guzzle and Diactoros?

@sagikazarmark
Copy link
Member

Where would it be necessary? By definition message factories accept string or UriInterface, so URIs are converted to an UriInterface by the message factory which means that you will never need to create an UriInterface object directly.

What use case can you imagine? Or is it for the sake of completeness? If so, StreamFactory implementations as well? (The message factory contract package has an interface for Messages, Uris, Streams as well)

@ddeboer
Copy link
Contributor Author

ddeboer commented Jun 5, 2015

Use case: an object that needs to perform HTTP requests (using php-http/adapter) and that you can set a base URI on (that will be used for any of the requests from that object). Instead of parsing and validating that URI on your own it makes sense to use any of the PSR-7 libraries that must be available anyway to create the request objects. I could of course delay the base URI validation until I create a message object from it, but that may be a bit late.

If you agree on the usefulness, I can open a PR.

@sagikazarmark
Copy link
Member

Valid point.

Would you like to provide a PR or let me do the hard copy-pasting? 😉

@ddeboer
Copy link
Contributor Author

ddeboer commented Jun 5, 2015

I was already copy-pasting it, so I’ll submit it in a minute.

@sagikazarmark
Copy link
Member

Cool 👍

ddeboer added a commit to ddeboer/discovery that referenced this issue Jun 5, 2015
ddeboer added a commit to ddeboer/discovery that referenced this issue Jun 5, 2015
ddeboer added a commit to ddeboer/discovery that referenced this issue Jun 5, 2015
ddeboer added a commit to ddeboer/discovery that referenced this issue Jun 5, 2015
ddeboer added a commit to ddeboer/discovery that referenced this issue Jun 5, 2015
ddeboer added a commit to ddeboer/discovery that referenced this issue Jun 5, 2015
ddeboer added a commit to ddeboer/discovery that referenced this issue Jun 5, 2015
ddeboer added a commit to ddeboer/discovery that referenced this issue Jun 5, 2015
ddeboer added a commit to ddeboer/discovery that referenced this issue Jun 5, 2015
sagikazarmark added a commit that referenced this issue Jun 5, 2015
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

No branches or pull requests

2 participants