1

I am currently writing an implementation of the HTTP Message Interface Recommendation (PSR-7) for my personal PHP framework. I've written classes for each interface in the recommendation. But now I realize that I do not need an abstraction for outbound requests.

At the moment I have:

  • Message for MessageInterface,
  • Request for RequestInterface,
  • Response for ResponseInterface,
  • ServerRequest for ServerRequestInterface,
  • Stream for StreamInterface,
  • UploadedFile for UploadedFileInterface, and,
  • Uri for UriInterface.

I wonder if I must implement every interface of the recommendation to claim my framework uses it? Or may I only implement the parts of I need?

Youmy001
  • 515
  • 3
  • 11
  • 1
    You don't need to implement a class for each interface. It depends on your needs. – Pedro Amaral Couto Apr 16 '18 at 17:44
  • Thank you. Upon further research, I learned that some server focused libraries, like the Slim framework, did not implement RequestInterface directly. I decided to do the same. https://github.com/slimphp/Slim/blob/3.x/Slim/Http/Request.php – Youmy001 Apr 17 '18 at 21:10

0 Answers0