Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Splitting StringResponse into HtmlResponse and JsonResponse #62

Closed
wants to merge 5 commits into from

Conversation

moufmouf
Copy link
Contributor

This is a follow-up to #61.

The HtmlResponse and JsonResponse classes mimics the behaviour of @weierophinney 's RedirectResponse and EmptyResponse (i.e. they directly extend the Response class instead of providing a factory)

Most of the JSON code for handling errors comes from Symfony's JsonResponse.

We could optionnally add a static create method to create the response (a bit like Symfony does...)

weierophinney added a commit to weierophinney/zend-diactoros that referenced this pull request Jun 24, 2015
- Per @moufmouf on zendframework#62, this patch adds some basic error handling to the
  `HtmlResponse` to ensure we have a either a string, or a
  StreamInterface instance, raising an InvalidArgumentException if not.
@weierophinney
Copy link
Member

Closing in favor of #61, on which @moufmouf is collaborating.

@moufmouf
Copy link
Contributor Author

👍

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

Successfully merging this pull request may close these issues.

2 participants