slimphp / Slim-Psr7

PSR-7 implementation for use with Slim 4
MIT License
133 stars 45 forks source link

withJson method is missing from Response class #152

Closed hhovakimyan closed 4 years ago

hhovakimyan commented 4 years ago

I am trying to upgrade Slim framework used in my project from version 3 to version 4 and during the process I suddenly found out that withJson method has gone from the Response class. I want to understand why it is gone? I understand that Response class implements PSR-7 ResponseInterface, where withJson method is not included. But I don't think implementing ResponseInterface forbids Response class having some helper methods which will be very helpful.

l0gicgate commented 4 years ago

You need to use https://github.com/slimphp/Slim-Http decorators to have access to the old helper methods.