There has been a lot of debates lately about PSR-7 middlewares and the main sticking point is whether or not to pass the response in the middlewares as parameter. The main argument for that is to avoid depending on a specific implementation.
How about releasing a new "PSR-7" (different number obviously) that would be a default implementation? That would solve the middleware problem, and that would be simpler too (no need to find an implementation).
I know some people wished it would have been that way from the beginning, but it's never too late to improve things. Do we need the interfaces? Is there any actual value in having different implementations since PSR-7 objects are value objects? Right now I don't see it and I haven't found anything in the PSR-7 metadocument.
We would have 3 options I guess:
1. write a separate package, deprecate PSR-7 and encourage using the standard implementation only
2. write a separate package that implements PSR-7 interfaces, but deprecate PSR7 and eventually remove completely the interfaces (PSR-X would be the recommended standard)
3. write a separate package that implements PSR-7 interfaces and keep both eternally
I think 3. is easy but would be confusing for everyone: should we type-hint against the interfaces or the implementation? I think everyone will have its opinion on this, and if the interfaces bring no additional value then they are only noise.
1. breaks BC a lot, so it might not be possible.
2. is IMO the best course of action as we have controlled backward compatibility yet a clear goal and best long-term solution.
What do you think?
> I don’t think we need to try to aim to create an organization that prevents people from making bad decisions. Instead the organization we need is one that allows someone to make that mistake in the timespan of about 5 months instead of 5 years, so room can be created for a new PSR that solves the 80% problem in a less ridiculous way.
And of course I don't think PSR-7 is a mistake ;) I'm just throwing out an idea…