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

Use PSR-7 for Request and Response #16

Closed
damianopetrungaro opened this issue Mar 2, 2018 · 4 comments
Closed

Use PSR-7 for Request and Response #16

damianopetrungaro opened this issue Mar 2, 2018 · 4 comments
Assignees
Labels

Comments

@damianopetrungaro
Copy link

I took a quick look, and I don't get why don't use an implementation of a PHP PSR for HTTP Request and Response?

@hollodotme
Copy link
Owner

hollodotme commented Mar 3, 2018

@damianopetrungaro Thank you for the question. The (short) answer is: This lib targets PHP >= 7.1 with strict parameter and return type declarations. PSR-7 targets PHP >= 5.3 (mostly) without any of these. Furthermore the request interface for this lib requires getters for callbacks which are not present in the PSR-7 interface. So it would need an PSR-7-extended interface for the request methods. The PSR-7 response is mutable, the response of this lib isn't. And I don't see a reason to change that.

But I have to admit that I didn't try to implement the lib with PSR-7, so I'd be happy if you find the time to give it a shot, check if it brings any advantages compared to the current solution and provide a PR for a review.

@damianopetrungaro
Copy link
Author

Return type can be easily added to your implementation using the PSR too.

Anyway, you can rethink your implementation for a more standard way.

As you said you're open to PRs so we can spend some time on it :)

@hollodotme
Copy link
Owner

Looking forward to it! Thanks.

@hollodotme
Copy link
Owner

After I was using PSR-7 implementations for a while now, I can say that they are not a good fit here, because they are made for HTTP and the FastCGI communication of this library has much in common with HTTP but neither use it nor is 100% compatible to it.

As this issue is stale for 8 months now, I'll mark it as wontfix and close it.
Anyway, if you see different arguments and have an implementation, feel free to provide PR.

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

No branches or pull requests

2 participants