-
Notifications
You must be signed in to change notification settings - Fork 39
Description
This is the opposite of php-http/adapter-core#3
I've been studying how the current interface model is built up and I wonder if we really need all those interfaces.
As I mentioned in the other issue, the implementations of these classes are internal. Furthermore, the request and the response are only including the MessageTemplate trait and a constructor, nothing more. So I wonder if we really need all those interfaces in the contract package.
Message is probably OK. MessageFactory and InternalRequest as well. But the other two interfaces? It seems to me that Request and Response are rather internal implementations which does not need their own interface.
Looking through the (contract) package there is only one place where these interfaces are used at all: exceptions. And even there, I would say we should typehint for PsrResponseInterface instead of the internal one. Nothing is used from the internal response object, so IMO we can safely widen the class dependency range.
I am going to provide a PoC PR to see if I can reduce the number of interfaces and find a way to avoid Interface suffix.